Using Subroutines in SAP script

Hi Experts,
I am trying to get value of Z variables from a subroutine pool program using Perform ... EndPerform in my sap script form.
In my form window i have written
PERFORM ITEM_LINE_2F IN PROGRAM ZMEPRINTFORMS
USING &EKPO-MENGE&
CHANGING &V_EKPO_MENGE&
ENDPERFORM
and in my subroutine pool program i have written:
FORM ITEM_LINE_2F TABLES IN_PAR STRUCTURE ITCSY
                                              out_par structure itcsy.
data :  ZLV_ekpo_menge(17),
          v_ekpo_menge(17),
         ZLV_temp_split_1(14),
         ZLV_temp_split_2(3),
         ZLV_temp_menge(8) type p.
constants: zc_menge type TDTPRGNAME value 'EKPO-MENGE'.
field-symbols: <tab> type itcsy.
  loop at in_par assigning <tab>.
    case <tab>-name.
      when zc_menge.
        zlv_ekpo_menge = <tab>-value.
      when others.
    endcase.
  endloop.
  unassign <tab>.
  V_EKPO_MENGE = zlv_ekpo_menge.
  SPLIT V_EKPO_MENGE AT '.' INTO ZLV_TEMP_SPLIT_1 ZLV_TEMP_SPLIT_2.
  IF ZLV_TEMP_SPLIT_2+0(3) = '000'.
    ZLV_TEMP_MENGE = zlv_ekpo_menge.
    WRITE ZLV_TEMP_MENGE TO V_EKPO_MENGE.
  ELSE.
    WRITE zlv_ekpo_MENGE TO V_EKPO_MENGE.
  ENDIF.
  loop at out_par assigning <tab>.
    case <tab>-name.
      when V_EKPO_MENGE.
        <tab>-value = v_ekpo_menge.
      when others.
       Modify out_par.
    endcase.
  endloop.
  unassign <tab>.

hi,
FORM ITEM_LINE_2F TABLES IN_PAR STRUCTURE ITCSY
out_par structure itcsy.
data : ZLV_ekpo_menge(17),
v_ekpo_menge(17),
ZLV_temp_split_1(14),
ZLV_temp_split_2(3),
ZLV_temp_menge(8) type p.
read table in_par index 1.
V_EKPO_MENGE = zlv_ekpo_menge = in_par-value.
SPLIT V_EKPO_MENGE AT '.' INTO ZLV_TEMP_SPLIT_1 ZLV_TEMP_SPLIT_2.
IF ZLV_TEMP_SPLIT_2+0(3) = '000'.
ZLV_TEMP_MENGE = zlv_ekpo_menge.
WRITE ZLV_TEMP_MENGE TO V_EKPO_MENGE.
ELSE.
WRITE zlv_ekpo_MENGE TO V_EKPO_MENGE.
ENDIF.
read table out_par index 1.
out_par-value = v_ekpo_menge.
Modify out_par.
but frankly speaking... i dint understand your logic... finally you are passing the same value ????????
regards
padma

Similar Messages

  • How to retrieve data from a function module and use it in sap script??

    I have a report program, which calls a function module. This function module internally calls an include program. In this program, I have a variable which is to be used in the sap script. How can I send this variable to the sap script

    Hi,
    In your case, Include prog is part of FM, no need to treat it as an Entity.
    Now, Your Answer -
    In SCRIPT - IN Page Window -->
         PERFORM GET_MVAT_TIN IN PROGRAM Z_SCRIPT_PERFORMS_ABAPDB3
         USING &VBDKR-KUNRE&
         CHANGING &STCD1&
         CHANGING &STCD2&
         ENDPERFORM
         IF &STCD1& <> ' '
         <B>MVAT Number :</> &STCD1&
         ENDIF
    Then go to SE38 --> Creat prog with type - Subroutine pool
    In that Write FORM statement for this PERFORM.
    FORM get_mvat_tin TABLES inttab STRUCTURE itcsy
                             outtab STRUCTURE itcsy.
      DATA : v_kunre TYPE kna1-kunnr,
             v_stcd1 TYPE kna1-stcd1,
             v_stcd2 TYPE kna1-stcd2.
      LOOP AT outtab.
        CLEAR outtab-value.
        MODIFY outtab.
      ENDLOOP.
      READ TABLE inttab INDEX 1.
      v_kunre = inttab-value.
      IF v_kunre CA sy-abcde.
      ELSE.
        UNPACK v_kunre TO v_kunre.
      ENDIF.
       " Here You can take your Funcion module ***************************
      SELECT SINGLE stcd1 stcd2 FROM kna1 INTO (v_stcd1, v_stcd2)
                                         WHERE kunnr = v_kunre.
      IF sy-subrc = 0.
        READ TABLE outtab INDEX 1.
        WRITE v_stcd1 TO outtab-value.
        MODIFY outtab INDEX 1.
        READ TABLE outtab INDEX 2.
        WRITE v_stcd2 TO outtab-value.
        MODIFY outtab INDEX 2.
      ENDIF.
    ENDFORM.                                

  • HOw can we Call Subroutine in Sap Script?

    HOw can we Call Subroutine in Sap Script?

    Hi
    *You have to call sub routine from script like this.
    /:   PERFORM DATE_FORMAT IN PROGRAM &SY-REPID&
    /:   USING &RM06P-LFDAT&
    /:   USING &PEKKO-LFDAT&
    /:   CHANGING &VALUE_OLD&
    /:   CHANGING &VALUE_NEW&
    /:   ENDPERFORM
    *In print program write code.
    FORM date_format TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
      DATA : date TYPE char10.
      DATA : date2 TYPE char10.
      DATA : l_dmbtr TYPE char10.
      READ TABLE in_tab WITH KEY 'RM06P-LFDAT'.
      IF sy-subrc = 0.
        "Your code goes here
        CLEAR l_dmbtr.
      ENDIF.
      READ TABLE in_tab WITH KEY 'PEKKO-LFDAT'.
      IF sy-subrc = 0.
        l_dmbtr = in_tab-value.
        "Your code goes here
        CLEAR l_dmbtr.
      ENDIF.
      READ TABLE out_tab WITH KEY 'VALUE_NEW'.
        IF sy-subrc EQ 0.
            out_tab-value = date2.
            MODIFY out_tab INDEX sy-tabix.
        ENDIF.
      READ TABLE out_tab WITH KEY 'VALUE_OLD'.
        IF sy-subrc = 0.
            out_tab-value = l_dmbtr.
            MODIFY out_tab INDEX sy-tabix.
        ENDIF.
    ENDFORM.            "DATE_FORMAT

  • ABAP Subroutines in SAP Script forms

    Hi Friends,
    Can any give an example on using ABAP Subroutines in SAP Scripts
    how to call ABAP  subroutine IN FORM  and how to define form statement in abap program
    thanks in advance
    Points for sure
    Regards
    Vijaya

    Hi,
    you have to write
    perform formname in program zprogram
    using  &var1&
    using &var2&
    changing &var3&
    endperform
    in se38 create program zprogram of subroutine pool ttype
    and
    write the
    form
    endform there
    egcode for  a subroutne for changing the amount into indian words
    PROGRAM  ZFII_SR_PAYMNT_CHCK.
    declaring the variables which are necessary
    DATA:
      G_AMOUNT       TYPE PC207-BETRG,          " having  amount value
      G_SPELL_AMOUNT(60)  TYPE C, " LIKE     SPELL-WORD,  " amount in words
      G_SPELL_AMOUNT1(60) TYPE C,        " spell structure
      G_WHTAX TYPE BSAK-QBSHB,   "
      G_QBSHB TYPE BSAK-QBSHB, " FOR COLLECTING THE WITH HOLDING TAX
      G_ZUMSK TYPE BSAK-ZUMSK.
    *DECLARING THE INTERNAL TABLES FOR THE OUTPUT TO BE DISPLAYED.
    TYPES : BEGIN OF T_INPUT_TABLE.
            INCLUDE STRUCTURE ITCSY.
    TYPES : END OF T_INPUT_TABLE.
    TYPES : BEGIN OF T_OUTPUT_TABLE.
            INCLUDE STRUCTURE ITCSY.
    TYPES: END OF T_OUTPUT_TABLE.
    DATA: GWA_INPUT_TABLE  TYPE T_INPUT_TABLE.
    DATA: GWA_OUTPUT_TABLE TYPE T_OUTPUT_TABLE.
    DATA: GIT_INPUT_TABLE TYPE STANDARD TABLE OF  T_INPUT_TABLE.
    DATA: GIT_OUTPUT_TABLE TYPE STANDARD  TABLE OF  T_OUTPUT_TABLE.
    TYPES : BEGIN OF T_ITEM,
              BUKRS TYPE BUKRS,
              BELNR TYPE BELNR_D,
              GJAHR TYPE GJAHR,
              WT_WITHCD TYPE WT_WITHCD,
              WT_QBSHB TYPE  WT_WT1,
             END OF T_ITEM,
           IT_T_ITEM TYPE STANDARD TABLE OF T_ITEM.
    DATA :  GIT_ITEM TYPE IT_T_ITEM,
            GWA_ITEM TYPE T_ITEM.
    GET_SPELL_AMOUNT
    FORM GET_SPELL_AMOUNT  TABLES  INPUT STRUCTURE ITCSY
                                   OUTPUT STRUCTURE ITCSY.      "#EC CALLED
    CLEARING OFF THE VARIABLE USED IN PROGRAM.
      CLEAR:  G_AMOUNT,
               G_SPELL_AMOUNT.
    *clearing the internal tables which we have used.
      CLEAR:
       GIT_INPUT_TABLE,
       GIT_OUTPUT_TABLE.
    *REFRESHING THE INTERNAL TABLES.
      REFRESH:
       GIT_INPUT_TABLE,
       GIT_OUTPUT_TABLE.
    *initially assigning the memory vaules to our internal tables.
      GIT_INPUT_TABLE[]  = INPUT[].
      GIT_OUTPUT_TABLE[] = OUTPUT[].
    *reading the table input to get the amount value.
      READ TABLE GIT_INPUT_TABLE INTO GWA_INPUT_TABLE   INDEX 1.
      IF GWA_INPUT_TABLE-VALUE CA 'X'.
        REPLACE ALL OCCURRENCES OF 'X' IN GWA_INPUT_TABLE-VALUE WITH '0'.
      ENDIF.
    *THIS IS IMPORTANT PART AS IT IS CONVERTING THE
    *CHARACTER FIELD INTO CURRENCY FIELD.
      SHIFT GWA_INPUT_TABLE-VALUE LEFT DELETING LEADING SPACE.
      TRANSLATE GWA_INPUT_TABLE-VALUE USING ', '.
      CONDENSE GWA_INPUT_TABLE-VALUE NO-GAPS.
      G_AMOUNT = GWA_INPUT_TABLE-VALUE.
    *calling the function moudle which will
    *covert amount into words (indian format ).
    *i.e in crores, lakhs, thousands
      DATA: L_SPELLAMOUNT(255) TYPE C,
            L_ONLY(255) TYPE C.
      CLEAR: L_SPELLAMOUNT, L_ONLY.
    *here the amount should not be more than
    99,99,99,999.99 . if it is greater than
    *this amount this function module will not work
    *so give the amount which is lessthan or equal to
    *above said amount.
      IF G_AMOUNT LT '1000000000'.
        CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
          EXPORTING
            AMT_IN_NUM         = G_AMOUNT
          IMPORTING
            AMT_IN_WORDS       = L_SPELLAMOUNT
          EXCEPTIONS
            DATA_TYPE_MISMATCH = 1
            OTHERS             = 2.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
      CONDENSE L_SPELLAMOUNT.
      TRANSLATE L_SPELLAMOUNT TO UPPER CASE.
      CONCATENATE L_SPELLAMOUNT 'ONLY' INTO L_ONLY SEPARATED BY SPACE.
    *moivng the field name into table field.
      GWA_OUTPUT_TABLE-NAME = 'G_SPELL_AMOUNT'.
    *assigning the amount in words to the variable.
    *the reason  behind splitting the word into two parts
    *is--- in the scripts the whole string is not getting
    *printed. So we are splitting it into two parts so that
    *it will print the whole string.
      G_SPELL_AMOUNT = L_ONLY+0(60).
      G_SPELL_AMOUNT1 = L_ONLY+60(60).
    G_SPELL_AMOUNT  = L_SPELLAMOUNT.
    *MOVING THE AMOUNT IN WORDS TO FINAL WORK AREA.
      MOVE G_SPELL_AMOUNT TO GWA_OUTPUT_TABLE-VALUE.
    *MODIFYING THE INTERNAL TABLE FORM THE WORK AREA.
      MODIFY  GIT_OUTPUT_TABLE FROM GWA_OUTPUT_TABLE INDEX 1.
    *FOR THE SECOND RECORD I.E FOR THE NEXT 60characters
      GWA_OUTPUT_TABLE-NAME = 'G_SPELL_AMOUNT1'.
      MOVE G_SPELL_AMOUNT1 TO GWA_OUTPUT_TABLE-VALUE.
      MODIFY  GIT_OUTPUT_TABLE FROM GWA_OUTPUT_TABLE INDEX 2.
    *assigning the total output table to the memory .
      OUTPUT[] =  GIT_OUTPUT_TABLE[].
    ENDFORM.                    "GET_COMPADDR
    thanks & regards,
    Venkatesh

  • How to call a subroutine from sap script

    hi friends,
    Can anybody tell me How to call a subroutine from sap script .
    thanks n regards .
    Mahesh

    hi..
    Calling ABAP Subroutines: PERFORM 
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY ‘PAGE’.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = ‘|’. "First page
    ELSE.
    OUT_PAR-VALUE = ‘||’. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    regards,
    veeresh

  • Call subroutine in sap script

    how can i call subroutine in SAP Script?& where?

    hi,
    refer d links
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/calling%2ba%2bsub-routine%2bin%2bsap%2bscripts
    subroutine in script. REWARDED
    abput subroutines in scripts
    How to call a subroutine in a script ?
    How to call subroutine in a sap script

  • How 2 debug a Perform subroutine in sap script

    Hi,
    I have a perform endperform in Script. But tht is not working in some case. i m trying to debug but i m not able to go inside the routine and see wht it is doing? . can any one help me how to debug a subroutine in sap script.

    Hi Panigrahi,
    1) Put a break point in your perform.
    2)  YOu should change the dispatch option in your Output screen of the transaction which triggers your sap script. The dispatch option should be 1 (Send with a periodically scheduled job).
    Then save your transaction.
    3) Go to se38 and run the program RSNAST00.
    Give the Object Key as the Document Number for which you are triggering the script output.
    The control will stop in your perform.
    Regards,
    Ravi

  • Calling subroutine from SAP script

    I am using the below code within my SAP script form that prints GR/GI Slips but its not working.  And the only way I can issue the output is from MB02 whcih doesn't seem to allow to call the debuger, so I'm at a lost as to what to do.
    Code in SAP script
    /:           PERFORM GET_BINS IN PROGRAM ZMM_SAPSCRIPT_FORMS                                                                               
    USING &MSEG-MATNR&
    /:                                                           USING &MSEG-LGNUM&
    /:                                                           CHANGING &MABDR-LGPBE&
    /:           ENDPERFORM
    CODE from my subroutine program:
    FORM get_bins TABLES input_table STRUCTURE itcsy
                         output_table STRUCTURE itcsy.
      DATA: lc_matnr    TYPE matnr,
            lc_lgnum    TYPE lgnum,
            lc_lgpla    TYPE lgpla,
            lc_index    TYPE sy-tabix.
    * Material no
      READ TABLE input_table WITH KEY name = 'MSEG-MATNR'.
      MOVE input_table-value TO lc_matnr.
    * Warehouse number
      READ TABLE input_table WITH KEY name = 'MSEG-LGNUM'.
      MOVE input_table-value TO lc_lgnum.
    * Get BIN
      SELECT SINGLE lgpla INTO lc_lgpla
             FROM mlgt
             WHERE matnr = lc_matnr
             AND   lgnum = 'CPT'  "lc_lgnum
             AND   lgtyp = '001'.
      IF sy-subrc = 0.
        READ TABLE output_table WITH KEY name = 'MABDR-LGPBE'.
        lc_index = sy-tabix.
        MOVE lc_lgpla TO output_table-value.
        MODIFY output_table INDEX lc_index.
      ENDIF.

    /:           PERFORM GET_BINS IN PROGRAM ZMM_SAPSCRIPT_FORMS
    /:                                                              USING &MSEG-MATNR&
    /:                                                           USING &MSEG-LGNUM&
    /:                                                           CHANGING &MABDR-LGPBE&
    /:           ENDPERFORM
    FORM get_bins TABLES input_table STRUCTURE itcsy
                         output_table STRUCTURE itcsy.
      DATA: lc_matnr    TYPE matnr,
            lc_lgnum    TYPE lgnum,
            lc_lgpla    TYPE lgpla,
            lc_index    TYPE sy-tabix.
    Material no
      READ TABLE input_table WITH KEY name = 'MSEG-MATNR'.
      MOVE input_table-value TO lc_matnr.
    Warehouse number
      READ TABLE input_table WITH KEY name = 'MSEG-LGNUM'.
      MOVE input_table-value TO lc_lgnum.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = lc_matnr
      IMPORTING
       OUTPUT        = lc_matnr         .
    Get BIN
      SELECT SINGLE lgpla INTO lc_lgpla
             FROM mlgt
             WHERE matnr = lc_matnr
             AND   lgnum = 'CPT'  "lc_lgnum
             AND   lgtyp = '001'.
      IF sy-subrc = 0.
        READ TABLE output_table WITH KEY name = 'MABDR-LGPBE'.
        lc_index = sy-tabix.
        MOVE lc_lgpla TO output_table-value.
        MODIFY output_table TRANSPORTING VALUE WHERE NAME = 'MABDR-LGPBE'.
      ENDIF.

  • Please help for using perform in SAP script

    As subject.
    My sap script code as below:
    /: PERFORM GET_CHAMT_DATE IN PROGRAM ZRAP004
    /:USING    &SPELL-WORD&
    /:CHANGING &SPELL-WORD&
    /:ENDPERFORM
    My program ZRAP004 code as below:
    FORM get_chamt_date USING u_iword TYPE spell-word
                       CHANGING u_oword TYPE spell-word.
    CONCATENATE u_iword '&#20803;&#25972;'(t01) INTO u_oword.
    endform.
    This form is for check printing.
    It's by standard function 'F110' to excute check printing.
    But when i finished this transaction. System return error message as below:
    <b>This routine contains 2 formal parameters, but the current call
    contains 4 actual parameters.</b>
    Please help. Thanks a lot!!

    Hiii
    PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
           INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
           INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
          w_vbeln LIKE vbak-vbeln,
          w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
               input  = w_ebeln
          IMPORTING
               output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.

  • Why do we use include in sap script text element

    Hi SDNers,
    Why do we use include statement or what does that stands for in an text element of a sap script.
    Details with examples and explanation please
    Thanks & Regards,
    Ranjith N

    Hi Ranjith,
    Please go through this.
    &VBDPL-ARKTX&
    /: INCLUDE &VBDPL-TDNAME& OBJECT VBBP ID 0001
    If your include contains
    = arflebarflegloop
    and vbdpl-arktx contains 'myarticletext'.
    Then the output document will contain a line:
    myarticletext arflebarflegloop
    If the include contains
    arfelbarflegloop
    then the output document will contain the lines:
    myarticletext
    arflebarflegloop
    (Subject to whatever the prevailing paragraph format is - * means use current format).
    Think about what would happen if instead of having an include, you hardcoded the text of the include in your sapscript.
    I found this at http://www.sapfans.com/sapfans/forum/devel/messages/31158.html
    Regards,
    Sharat.

  • How do we identify the standard texts used in a sap script?

    Hi,
    Is there any way that i can identify the standard texts used in SAP scripts?
    Not manually going to each window in the script and checking.
    Will there be any table where I can look ?
    Thanks,
    krishna.

    Hi,
    GO to the forminfo of the sapscript in SE71..and then search for INCLUDE
    after displaying the form...utilities->form info..
    hope this works..
    Thanks
    Naren

  • Dispaly standard text in SAP SCRIPT which content saved using SAVE_TEXT FM

    I want to display one standard text content in SAP SCRIPT and want to store content of it during run time.
    For that, first I have created one standard text using SO10.Named the standard text as Z_TEST_WRITE. Initially it was empty.
    In my SAP SCRIPT, I try to display the content of the standard text using below given SAP SCRIPT code and report program. Although I am able to store text in Standard text
    Z_TEST_WRITE but in first display of the SCRIPT it is not displaying against the include command of SAP SCRIPT. But when I see the content of Z_TEST_WRITE through SO10 transaction, I can see the content with new text which was previously empty.
    Now if I do the same transaction newly (suppose second time), then text stored in standard text Z_TEST_WRITE is displaid against includes command of SAP SCRIPT.
    My print program is a SAP STANDARD which one can be changed.
    /:   DEFINE &NAME& = ''                                      
    /:   PERFORM TEST IN PROGRAM Z_SAVE_TEXT
    /:   CHANGING &NAME&                                         
    /:   ENDPERFORM                                              
      <B>&NAME&</>                                            
    /:   INCLUDE Z_TEST_WRITE OBJECT TEXT ID ST
    REPORT  Z_SAVE_TEXT.
    FORM TEST TABLES IN_PAR STRUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
      DATA IT_HEADER LIKE TLINE OCCURS 0 WITH HEADER LINE.
      DATA: LS_HEADER LIKE THEAD,
            LT_LINES  TYPE STANDARD TABLE OF TLINE WITH HEADER LINE.
      OUT_PAR-NAME  = 'NAME'.
      OUT_PAR-VALUE =  'Sample text for Test'.
      APPEND OUT_PAR.
    *-Populate Header Text details
      LS_HEADER-TDOBJECT  = 'TEXT'.
      LS_HEADER-TDNAME    = 'Z_TEST_WRITE'.
      LS_HEADER-TDID      = 'ST'.
      LS_HEADER-TDSPRAS   = SY-LANGU.
    *-Populate details of Text
      CONCATENATE 'Shipment No   :' 'RM Ship No' INTO LT_LINES-TDLINE
      SEPARATED BY SPACE.
      LT_LINES-TDFORMAT = '*'.
      APPEND LT_LINES.
      CONCATENATE 'Bill of Lading:' '1234567' INTO LT_LINES-TDLINE
      SEPARATED BY SPACE.
      APPEND LT_LINES.
    *-Save Text
      CALL FUNCTION 'SAVE_TEXT'
        EXPORTING
          CLIENT          = SY-MANDT
          HEADER          = LS_HEADER
          SAVEMODE_DIRECT = 'V'
        TABLES
          LINES           = LT_LINES
        EXCEPTIONS
          OTHERS          = 1.
      IF SY-SUBRC NE 0.
        EXIT.
      ENDIF.
    COMMIT WORK and WAIT.
    ENDFORM.                    "TEST

    Hi,
      If the text is getting displayed the second time, then this should be due to delay in saving the text.
    After your COMMIT WORK AND WAIT in your report program, just put a WAIT FOR 2 SECS and check again.
    Regards,
    Suganya

  • Perform in SAP script

    how should i call a perform statement in SAP script
    I have been trying to use it in sap script but it is giving me a dump
    the code extract looks as follows:
    iN DRIVER'S PROGRAM
    FORM POP_ADD USING V_parvw like vbpa-parvw.
    READ TABLE i_addr WITH KEY WF_PARVW = 'WE'.
    ENDFORM.
    IN SAP SCRIPT
    /:   DEFINE &V_PARVW& = &VBPA-PARVW&          
    /:   PERFORM POP_ADD IN PROGRAM ZSD_SCR_INVOICE
    /:   USING            &V_PARVW&               
    /:   ENDPERFORM                               
    /    &i_addr-WF_PARVW&                        
    IT IS GIVING SHORT DUMP SAYING
    In a subroutine call, there were more parameters than in the                  
    routine definition.                                                           
    Error in ABAP application program.                                                                               
    The current ABAP program "ZSD_SCR_INVOICE " had to be terminated because one of
    the                                                                          
    statements could not be executed.                                                                               
    This is probably due to an error in the ABAP program.

    Hi,
    The PERFORM in your program should have the following syntax:
    FORM POP_ADD TABLES IN_TAB  STRUCTURE ITCSY
                        OUT_TAB STRUCTURE ITCSY.
    READ TABLE in_tab WITH KEY 'V_PARVW'.
    CHECK sy-subrc EQ 0.
    ENDFORM.
    Take a look at http://www.sapfans.com/forums/viewtopic.php?t=131082&highlight=perform for an example of the required syntax.
    Hope this helps.
    Regards

  • Payment Advice Sap Script 'F110_IN_AVIS' T-code F110

    Hi,
    I am using the standard SAP Script form 'F110_IN_AVIS' for generating Payment Advice through transaction code F110. F110 generates a spool request for the Payment Advice.
    Now since a SAP Script output is coming in spool request. It means the whole process is running in background and I am not able to debug the SAP Script 'F110_IN_AVIS'.
    Please tell me is their any way by which I can generate a direct printout without a Spool Request so that I can debug the SAP Script.
    Regards,
    Nitin

    if you want the print out,
    you have to modify the OPTIONS...values...maybe as of now the program is not issuing the printout they passing the parametes only for spool.
    wht u can do is set the "Print parameters, print immediately" to X..
    ITCPO-TDIMMED = 'X'.
    CALL FUNCTION 'OPEN_FORM'
      EXPORTING
        DEVICE   = 'PRINTER'
        DIALOG   = ''
        FORM     = '............'
        LANGUAGE = SY-LANGU
        <b>OPTIONS  = ITCPO</b>
      EXCEPTIONS
        CANCELED = 1
        DEVICE   = 2
        FORM     = 3
        OPTIONS  = 4
        UNCLOSED = 5
        OTHERS   = 6.
    I hope it helps you

  • Create SAP Script Style and link to Script

    Hi,
    How to create SAP Script Style through SE72...and how to implement it to Script..
    Means where to implement to Script..for ex. below code is script code of ZMEDRUCK...
    /: INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID& LANGUAGE &EKKO-SPRAS& PARAGRAPH IX
    Please tell me where i use that style...
    Regards.

    Hi.
    Maybe, I think that the purpose of style is to use it with SO10.
    Therefore, it doesn't use it in SAP script.
    SAP script copies with SE71 and changes.

Maybe you are looking for

  • Multi-Currency Customer Receivables Aging Query

    Hello Everyone, SAP B1 2005 SP 01 PL 42 We cannot produce customer statements for multi-currency accounts (CND & USD) through the Customer Receivables Aging report.  The report converts all FC to LC which is not useful to the customer. The statement

  • Search function not working in DS 5.2 Patch 4 help!!!

    I am using the java interface, and when I do a search for users or groups, no matter what critera I enter, I get 0 results, and also in my People listing and group listing, is there a way to sort alphabetically? Thanks for any help you can give me.

  • Clean out unwanted Printers and Localizations

    After a rather stressful installation of Leopard on my PB 17", and subsequent stressless installations on my family's Mac Mini and iBook 14", I'm now looking to reclaim some of the 5GB or so of free space I lost on each of the disks. I've identified

  • Need a Little Help embedding a Hyper Link in Report  based on Dynamic SQL

    I am trying to have a column in my report link to a document on my network when the column in the report is clicked. I have a table that contains a row for each document I want to link to. The URL to the document is stored in a column named NDDL.DOC_

  • Problem in FEBA / FB05 with document type

    Hi: I have a requirement. My users need the possibiliyu to choose the document type when they use FEBA TX. When FEBA is used, it calls FB05 TX, but you cannot choose the document class. We have defined a posting rule that uses in only a document type