Sunday, February 27, 2011

Electronic Invoicing to remove the & and $ symbols in idoc message

 move t100-text to text+len.
   move text to akt_message.
   BUFFER = T100-TEXT.
*if first &1/&2/&3/&4 or. $1/$2/$3/$4 replace
   IF T100-TEXT CA '$1'.
     REPLACE '$1' WITH INT_EDIDS-STAPA1 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '$2'.
     REPLACE '$2' WITH INT_EDIDS-STAPA2 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '$3'.
     REPLACE '$3' WITH INT_EDIDS-STAPA3 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '$4'.
     REPLACE '$4' WITH INT_EDIDS-STAPA4 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '&1'.
     REPLACE '&1' WITH INT_EDIDS-STAPA1 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '&2'.
     REPLACE '&2' WITH INT_EDIDS-STAPA2 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '&3'.
     REPLACE '&3' WITH INT_EDIDS-STAPA3 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '&4'.
              REPLACE '&4' WITH INT_EDIDS-STAPA4 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '$'.
    REPLACE '$' WITH INT_EDIDS-STAPA1 INTO BUFFER.
    REPLACE '$' WITH INT_EDIDS-STAPA2 INTO BUFFER.
    REPLACE '$' WITH INT_EDIDS-STAPA3 INTO BUFFER.
    REPLACE '$' WITH INT_EDIDS-STAPA4 INTO BUFFER.
   ENDIF.
   IF T100-TEXT CA '&'.
    REPLACE '&' WITH INT_EDIDS-STAPA1 INTO BUFFER.
    REPLACE '&' WITH INT_EDIDS-STAPA2 INTO BUFFER.
    REPLACE '&' WITH INT_EDIDS-STAPA3 INTO BUFFER.
    REPLACE '&' WITH INT_EDIDS-STAPA4 INTO BUFFER.
   ENDIF.
   CONDENSE BUFFER.
  MOVE buffer to akt_message.
   
          exit.
     

To calculate the time difference

FORM calculate_time_diff_in_sec USING before_date LIKE sy-datum
                                      before_time LIKE sy-uzeit
                                      now_date    LIKE sy-datum
                                      now_time    LIKE sy-uzeit
                                      time_diff   TYPE i.
  DATA: delta_date TYPE i,
        delta_time TYPE i.

  delta_date = now_date - before_date.
  delta_time = now_time - before_time.

  IF delta_date < 0.                   " irregular situation
    time_diff = 0.
  ELSEIF delta_date > 2000.            " avoid overflow
    time_diff = 0.
  ELSE.
    time_diff = delta_date * 86400 + delta_time.
    IF time_diff < 0.                  " irregular situation
      time_diff = 0.
    ENDIF.
  ENDIF.
ENDFORM.                               " CALCULATE_TIME_DIFF_IN_SEC

Saturday, February 26, 2011

To restrict the select-options popup message


TYPE-POOLS sscr.

DATA: restrict     TYPE sscr_restrict,
      opt_list     TYPE sscr_opt_list,
      associate    TYPE sscr_ass.

CLEAR :opt_list,associate,restrict.

* Set the complex
  MOVE 'EQ'  TO opt_list-name.
  opt_list-options-eq = 'X'.
  APPEND opt_list TO restrict-opt_list_tab.
  associate-kind    = 'S'.
  associate-name    = '<select-option name>'.
  associate-sg_main = 'I'.
  associate-sg_addy = ' '.
  associate-op_main = 'EQ'.
  associate-op_addy = 'EQ'.
  APPEND associate TO restrict-ass_tab.

  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
      program                      = sy-repid
      restriction                  = restrict
*   DB                           = ' '
   EXCEPTIONS
     too_late                     = 1
     repeated                     = 2
     selopt_without_options       = 3
     selopt_without_signs         = 4
     invalid_sign                 = 5
     empty_option_list            = 6
     invalid_kind                 = 7
     repeated_kind_a              = 8
     OTHERS                       = 9


Note: It should be declared in the PBO in Module pool program.

Wednesday, February 9, 2011

To get selection parameter

use FM: RS_REFRESH_FROM_SELECTOPTIONS

ex:
 CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
   EXPORTING
     curr_report     = 'ZTEST_CS15'
   TABLES
     selection_table = it_seltab
   EXCEPTIONS
     not_found       = 1
     no_report       = 2
     OTHERS          = 3.

Tuesday, February 1, 2011

SE63 Translation Transport-RS_LXE_RECORD_TORDER SAP Report

do this way,
se63 - > translation(menubar) -> R3 enterprise -> short texts -> S3abap texts -> REPT text elements.

Then give ur source and target languages.

if translation had been automatic it has to reflect here. else do the translation manually.

then it will work proper..

actually when u go for text elements in the report it should have asked u as a pop up "texts displayed in source language" . if u have selected yes then translations wont reflect..


se the transaction 'SE76' to change the language of form.

To change the SAP Script text you need to go to T-Code se63. Here you can give the text name, language and the conversion to which language you require to.

TO TRANSLATE SCRIPT / SMARTFORM TO OTHER LANGUAGES

Go to SE63.

From the Menu Bar Select Translation - > ABAP Objects - Other Long Texts

Click the Forms & Styles tab and double click on Forms

A screen will appear , provide the form name as input for Object name

You can change and source and target language and press edit.

Details of tcode SE63

Transaction SE63 enables you to perform the following activities:

1)Call up an individual object to translate it directly
2)Call up a personal worklist to find and translate objects that need translating in the collections assigned to you
3) Define your settings to suit the way you want to work with the translation tools

Features
Transaction SE63 enables you to translate texts in the following three kinds of objects:
a) ABAP objects:

These objects are classic objects created in an SAP system. ABAP objects are primarily divided into the following main categories:

i) Short texts

Short texts consist of text fragments that appear on the user interface (for example, Save, Print, Create Order.) The text elements for data elements and programs are examples of short text objects.

ii) Long texts (documentation)

Long text objects are documentation objects written in transaction SE61, such as message documentation and program documentation.

iii) Other long texts

These objects include SAPscript forms, styles, and SAP Smart Forms.

iv) Special texts XSS area pages

Table texts from the XSS area, which are technically defined as STRING types.

v) Transport objects

This enables you to translate objects that belong to a transport request, such as R3TR PROG ZZ_CREATE_INVOICE

b) Non-ABAP objects

These objects have been created outside an ABAP system using a programming language other than ABAP. Non-ABAP objects are primarily divided into three main categories:

i) Interface texts (fragments)

These are short, independent texts that consist of just a few words (such as pushbuttons and column headers.) They do not contain any continuous text.

ii) Interface texts (sentences)

These sentences belong together to form continuous text (for example, a short set of instructions). Formatting is only possible at the end of a sentence (end of paragraph).

iii) Objects with own formatting

This text type contains continuous text and information on how each individual line is formatted.

Defining Your Translator Settings
Whenever you start working in a new SAP system for the first time, you need to define the following settings:

...

1. On the initial screen of transaction SE63, choose Utilities ®Settings.

2. Under Languages, check that your default source and target languages are correct. If they are not correct, you have to specify the source and target languages each and every time you call up a personal worklist.

3. Under Short Text Editor, proceed as recommended in Short Text Editor Settings.

4. Under Long Text Editor, proceed as recommended in Long Text Editor Settings.

5. Under Worklist, proceed as recommended in Worklist Settings.

Accessing the Statistics from Transaction SE63
On the initial screen of transaction SE63, choose Goto -->Statistics.

Accessing the Proposal Pool from Transaction SE63
On the initial screen of transaction SE63, choose Goto -->Proposal Pool.

Accessing the Translation Environment from Transaction SE63
On the initial screen of transaction SE63, choose Goto -->administration.




Please execute the following program for transporting translations : RS_LXE_RECORD_TORDER
RS_LXE_RECORD_TORDER is a standard ABAP report available within your SAP system (depending on your version and release level). Below is the standard documentation available for this report and a few details of other objects it interacts with such as tables, function modules, includes etc. If you would like to see the full code listing simply enter the object name( RS_LXE_RECORD_TORDER ) into the relevant SAP transaction such as SE38 or SE80

Within the comments section below there is also an opportunity for anyone to be able add useful hints and information specific to this SAP object. This means that you and other users will be able to find these details quickly by simply searching on the object name.
http://www.saptechnical.com/Tutorials/Smartforms/TransportRequest/Assign.htm

how-to-transport-translations-made-in-se63-without-access-to-slxt-or-authorization-for-transport-request-creation

http://help.sap.com/saphelp_nw73/helpdata/en/46/3892c1be5c1ea9e10000000a1553f6/content.htm