Perform statement

Hi all,
I am using perform statement in sap script.
I need take a "Terms of payment" text in a PO, the length of text is 180, but when return the text to script only take the 80 first words.
The ABAP code is:
data: text(255) type c.
call function 'READ_TEXT'
  exporting
   id = id
   language = language "sy-langu
   name = name
   object = object
  tables
   lines = tlinetab
  exceptions
    others = 8.
if sy-subrc = 0.
  loop at tlinetab.
    concatenate text tlinetab-tdline into text
    separated by space.
  endloop.
endif.
clear tlinetab.
refresh : tlinetab.  clear tlinetab.
read table out_table with key name = 'TEXT'.
ind = sy-tabix.
write text to out_table-value.
out_table-value = out_table-value.
modify out_table index ind.
The Sap Script code is:
/:   DEFINE &ZID& = 'F07'               
/:   DEFINE &ZOBJECT& = 'EKKO'          
/:   PERFORM TEXTOS IN PROGRAM ZPEDIDO  
/:     USING &ZOBJECT&                  
/:     USING &ZID&                      
/:     USING &EKKO-EBELN&               
/:     CHANGING &TEXT&                
/:   ENDPERFORM
When I´m debugging the ABAP program the value that take the variables text and out_table-value is correct, but in the script is wrong.
How I resolve this problem?
Thank for u help.
John.

Hi John,
How is your variable &TEXT& declared?
If it is done as a locale variable in the SAPscript form using the "DEFINE" clause, the maximum length will be 60 characters.
Try to define a variable in your main print program. This might work better.
See also:
http://help.sap.com/saphelp_47x200/helpdata/EN/d1/8031d0454211d189710000e8322d00/content.htm
Regards,
Arjan Aalbers

Similar Messages

  • Can we use Perform statement in start routine ,Form and endform.

    Hi,
    Can we use Perform statement in start routine ? Then write the ABAP code between Form and Endform.
    Example : Can I use Perform ABC in start routine. Then define ABC at the end of start routine.
          Form ABC,
          ......<ABAP> code .....
          Endform.

    Hi,
    In BI 7.0 we have start routines defined using Class where you might be able to create your own performs, but in case of BW3.5 Start routines are defined using Form so there I don't think it will allow you to create one more form.
    But you can surely try both the approaches.
    Reards,
    Durgesh.

  • Perform statement in SAP scripts

    Hi experts,
    My requirement is that I don't want to display line items for particular customer with a particular item category, For this purpose I was asked to create a Z table with fields customer number(KUNNR) and Item category(PSTYV) and I have to make changes only in layout but not in driver program. So how do i do it? How to write preform statement in form layout which satisfies my requirement. And also in this perform statement I have to check if that customer and item category exists in that Z table. If so then I should not display the line item in the output else the line item should be displayed.
    Thanks in Adv.
    Vasu

    Hi,
    write this in script (Ex:Main Window)
    /:           PERFORM GET_COMM_CODE_DESC IN PROGRAM ZVPPACKL
    /:           USING &VBDPL-MATNR&
    /:           USING &VBDPL-WERKS&
    /:           USING &VBDPL-STAWN&
    /:           USING &VBDKL-ALAND&
    /:           CHANGING &STAWN&
    /:           CHANGING &TEXT1&
    /*           Begin of Insert -- PRAVIKAN -- DV2K933249 -- PR091808
    /:           CHANGING &W_COMMODITY_EU&
    /:           CHANGING &W_COMMODITY_DESC_EU&
    /*           End of Insert -- PRAVIKAN -- DV2K933249 -- PR091808
    /:           ENDPERFORM
    Driver program (ZVPPACKL)
    FORM get_comm_code_desc TABLES intab STRUCTURE itcsy
                                   outtab STRUCTURE itcsy.
      DATA: stawn LIKE t604t-stawn,
           matnr LIKE marc-matnr,                               "CL060501
           werks LIKE marc-werks,                               "CL060501
            land1 LIKE t604t-land1,
            text1 LIKE t604t-text1,
            w_commodity_eu       TYPE stawn,                    "PR092908
            w_commodity_desc_eu  TYPE bezei40.                  "PR092908
      READ TABLE intab WITH KEY name = 'VBDPL-MATNR'.           "CL060501
      matnr = intab-value.                                      "CL060501
      READ TABLE intab WITH KEY name = 'VBDPL-WERKS'.           "CL060501
      werks = intab-value.                                      "CL060501
      land1 = intab-value.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = matnr
        IMPORTING
          output = matnr.
      CLEAR: stawn,
             text1.
      SELECT SINGLE stawn
              INTO stawn
              FROM marc
             WHERE matnr = matnr
               AND werks = '3101'.
      IF NOT stawn IS INITIAL.
        SELECT SINGLE text1
                 INTO text1
                 FROM t604t
                WHERE spras = 'EN'
                  AND land1 = 'US'
                  AND stawn = stawn.
      ENDIF.
      CLEAR: w_commodity_eu,
             w_commodity_desc_eu.
      SELECT SINGLE stawn
              INTO w_commodity_eu
              FROM marc
             WHERE matnr = matnr
               AND werks = '0010'.
      IF NOT w_commodity_eu IS INITIAL.
        SELECT SINGLE text1
                 INTO w_commodity_desc_eu
                 FROM t604t
                WHERE spras = 'EN'
                  AND land1 = 'GB'
                  AND stawn = w_commodity_eu.
      ENDIF.
      READ TABLE outtab WITH KEY name = 'STAWN'.                "CL060501
      outtab-value = stawn.                                     "CL060501
      MODIFY outtab INDEX sy-tabix.
      READ TABLE outtab WITH KEY name = 'TEXT1'.
      outtab-value = text1.
      MODIFY outtab INDEX sy-tabix.
      READ TABLE outtab WITH KEY name = 'W_COMMODITY_EU'.
      IF sy-subrc EQ 0.
        outtab-value = w_commodity_eu.
        MODIFY outtab INDEX sy-tabix.
      ENDIF.
      READ TABLE outtab WITH KEY name = 'W_COMMODITY_DESC_EU'.
      IF sy-subrc EQ 0.
        outtab-value = w_commodity_desc_eu.
        MODIFY outtab INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "GET_COMM_CODE_DESC
    Regards
    Krishna

  • How to use perform statements in sap scripts

    how to use perform statements in sap scripts . and pls send me one progam for this
    thnaks
    raja

    Hi Raja,
    <b>PERFORM</b> key work is used to include subroutine in sapscript form...
    But the processing is lttle bit different form the one we use in ABAP.
    Here the paramters passed to form is stored in internal table of name-value table. there are two table one for inbound parameter and other for outbound parameters.
    Check out the example below to see how this is used..
    <b>Definition in the SAPscript form:</b>
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    <b>Coding of the calling ABAP program:</b>
    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.
    Hope this is clear to understand...
    Enjoy SAP.
    Pankaj Singh.

  • HOW TO USE PERFORM STATEMENT IN SMARTFORMS

    Hi,
    Can anyone tell me how to use call subroutine in smartform?
    Thanks & Regards,
    Gauarv.

    Hi,
    Hope this helps you..
    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.

  • Perform statement in ECC 6.0

    hi,
    So is it the best practice that we have to avoid creating FORM-ENDFORM in ECC 6.0 and also avoid using PERFORM statement ? what will be the alternative for this ?
    I have a couple of includes where there are lots of FORMS.
    thks

    Use METHODS instead of creating FORM-PERFORM. ECC is all about Object Oriented Concepts.

  • Problem with perform statement

    Hi All,
        I 'm in PAI event. i'm writing code for a check box. there
              CASE SY-UCOMM.
                  when 'FC'.
                 here i need to write a select statement like
         select field from database into itab where field1 = itab1-field1.
                    This itab1 data is in the following form.
    FORM user_comm USING r_ucomm LIKE sy-ucomm
                                      rs_selfield TYPE slis_selfield.
    so how can i use this form in my PAI?
    can anybody help me.
    thanks
    g.s.naidu

    Hi can anybody tell me how can i write a perform statement for a form statement.
    i want to write a perform statement for this
    " FORM user_double_click_on_sumry USING r_ucomm LIKE sy-ucomm
                                      rs_selfield TYPE slis_selfield.
    this is from alv grid function module   when we try to move to next screen we pass this parameter.
                i_callback_user_command = 'user_double_click_on_sumry'.
    now i want to use this form statement some where else. so can anybody tell me how can i write the perform for the above form statement.
    thanks
    g.s.naidu

  • Passing itab in a perform statement

    Hi Experts,
    In a Fucn Module, I need to write a perform statement and the corresponding FORM lies in an include. I need to pass an internal table(itab) & workarea(wa_itab) in perform as below :
    Declaration of itab:
    types: BEGIN OF ty_out1,
             f1(16) TYPE c,
             f2 TYPE wrbtr,
           END OF ty_out1.
    data : itab type standard table of ty_out1,
              wa_itab type ty_out1,
    PERFORM <form name> tables itab
      USING wa_itab
      test1.
    Dbl click on above perform takes us to an include prog and the form is declared as below -
    what should be the syntax of the FORM in INCLUDE statement.
    Note: I should not use the top include of the main prog for any declarations.
    form search_slash tables ptab2 like itab
                   using wa2_itab like wa_itab
                   test2 .
    Now what should be the syntax of the form above? Is the above right?
    Please suggest
    Thanks
    Dan

    Hi,
    If you want to pass only the internal table with header line,
    then use tables ptab2 structure wa2_itab
    For internal table with header line use:
    tables ptab2 like wa2_itab
    or
    tables ptab2[ ] like wa2_itab.
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

  • Is it possible we can write a perform statement in BADI?

    Hi ,
    Is it possible we can write a perform statement in BADI? Can any one please let me know .
    Thanks.

    Sure it is possible,  you just have to reference the program inwhich  the FORM exists.  Since the call is in a method, where do you put the actual FORM, well you need to put it in a separate program or subroutine pool, then you can call it from within the method.
    perform some_form in program zsubroutine_pool.
    Regards,
    RIch Heilman

  • Passing tables with PERFORM statement

    Hi all,
    There is a table returned by a function module ZCDAPO_MATNR_CHECK_FOR_QUOTA .
    I want to use the table returned by this FM  in a subroutine.
    So i pass this table thru FORM statement.
    within  PERFORM  and ENDFORM i want to use the data in this table
    and do some manipulation.
    but i am getting an error saying for typing TABLES parameter only table types should be used
    can anyone tell me where i am going wrong or please tell me how use tables in this PERFORM statement.for reference i will paste the code below,
    TYPES  : BEGIN OF x_quota     ,
                   trpid type ztrpid    ,
                   quota TYPE decv1_3   , 
                   END OF x_quota       .
    DATA :  it_qheader TYPE TABLE OF zapo_trqtah,
                 wa_it_qheader LIKE LINE OF it_qheader.
    DATA:    it_qitem TYPE TABLE OF zapo_trqtap,
                 wa_it_qitem LIKE LINE OF it_qitem.
    DATA   : it_quotavalue      TYPE TABLE OF x_quota                    ,
                  wa_it_quotavalue   LIKE LINE  OF it_quotavalue              .
    CALL FUNCTION 'ZCDAPO_MATNR_CHECK_FOR_QUOTA'
          EXPORTING
            i_matnr            = 'AATESTQUOTA2'
            i_werks            = '5034'
          IMPORTING
            e_quota_exist_flag = lv_flag
          TABLES
            t_zapo_trqtap      = it_qitem
            t_zapo_trqtah      = it_qheader
          EXCEPTIONS
            invalid_input      = 1
            OTHERS             = 2.
    perform f_loadquota_apo TABLES it_qitem.
    form f_loadquota_apo tables it_qitem type zapo_trqtap.
                     LOOP AT it_qitem INTO wa_it_qitem.
                     wa_it_quotavalue-trpid = wa_it_qitem-ztrpid.
                     wa_it_quotavalue-quota = wa_it_qitem-zquota / lv_sum.
                     append wa_it_quotavalue to it_quotavalue.
                     endloop.
    endform.

    Hi..
    Using TABLES is like obselete.
    So change your code like this:
    Call the Subroutine like this:
    <b>perform f_loadquota_apo using it_qitem[].</b>
    You can change the Definition of Form like this:
    <b>form f_loadquota_apo USING  it_qitem LIKE zapo_trqtap[].</b>
    LOOP AT it_qitem INTO wa_it_qitem.
    wa_it_quotavalue-trpid = wa_it_qitem-ztrpid.
    wa_it_quotavalue-quota = wa_it_qitem-zquota / lv_sum.
    append wa_it_quotavalue to it_quotavalue.
    endloop.
    endform.
    <b>Reward if Helpful</b>

  • Logging performance stats externally

    Can I programatically obtain the kind of performance stats
    you see in the management interface, e.g. get a count of number of
    connections, number of active streams etc.
    We use tools like munin and nagios for server tracking, I'd
    like to integrate FMS into this.
    Can anyone recommend the best way to go about this?

    I suppose the best way to do it depends on the structure of
    your application and what data you need to collect. Data about
    connected clients and streams can be obtained through your
    application, but if you want to track data transfer, bandwidth
    usage, license usage, etc.... you'll need to make a connection to
    the admin service.
    You can use a .swf to retrieve the data as FMS-Developer
    mentioned, but you can also have that happen on the server side.
    You can build an FMS app that will run with no connected clients,
    and report server stats back to your remoting service, XML socket
    server, or to any app server that accepts http post/get requests.
    If you don't use an .swf, you just need to design the app so it
    doesn't shut down when the server does garbage collection (return
    false in your onAppStop handler), and you'd need to start it
    through the admin console.
    Since most of the http side backend I do is PHP I prefer to
    use AMFPHP for things like this, but there are a world of
    otheroptions. If you provide some detail about the data you need to
    collect and how you need to collect it, and about your
    server/application server/web service model, maybe we can come up
    with ideas about the best option.

  • How to use " PERFORM ", STATEMENT WITH OFFSET

    hI,
    How we use Perform statement with offset, like
      Example:   " PERFORM READ_SEGRELEASE USING INT_EDIDC+11."
    My requirement is to use Perform with Automatic length declaration.
    Automatic length declaration in PERFORM statement
    Kindly Explain and Provide some Example programm written in this situation.
    Thanks,
    P.N.Kumar

    Hiere is an example of what you probably require:
    DATA:
    lv_offset        TYPE syoffi,
    lv_length        TYPE flength,
    lv_field          TYPE string.
    lv_field  = 'This is my value: hello world'.
    lv_length = 5.
    lv_offset = 18.
    PERFORM read_segrelease USING lv_field
                                                            lv_length
                                                            lv_offset.
    *&      Form  READ_SEGRELEASE
    *       text
    *      -->P_LV_FIELD  text
    *      -->P_LV_LENGTH  text
    *      -->P_LV_OFFSET  text
    FORM read_segrelease USING    p_lv_field         TYPE string
                                                         p_lv_length      TYPE flength
                                                         p_lv_offset      TYPE syoffi.
      DATA:
      lv_result    TYPE string.
      lv_result = p_lv_field+p_lv_offset(p_lv_length).
      WRITE: / lv_result.
    ENDFORM.                    " READ_SEGRELEASE

  • Perform statements

    Hello All,
    What is the difference between the following statements:
    1. PERFORM get_vbap_using_vbak TABLES t_vbak t_vbap.
    2. PERFORM get_data TABLES t_vbak
    Waiting for the reply,
    Thanks,
    Shreekant

    Hi Shreekant Rangrej,
    there is no much difference between the two statements.
    PERFORM get_vbap_using_vbak TABLES t_vbak t_vbap.
    PERFORM get_data TABLES t_vbak
    get_vbap_using_vbak  is the PERFORM NAME
    But the First PERFORM statement is using two tables in TABLES PARAMETER.
    T_VBAK and T_VBAP
    Best regards,
    raam

  • Find perform statement in MB1B which is calling Form statement in Zprogram

    Hi,
    we written form statement in zprogram, it is called in MB1B transaction.this linked
    to one output type.my problem is how to find  perform statement in MB1B.
    Do help at earliest.
    Thanks in advance.
    Rama.
    SAP-Techincal consultant.

    Thanks for reply.
    in zprogram we have been updating ztables.problem here is even we set break point here, cursor  not coming into that subroutine when we run transaction MB1B.
    CAN U PLZ say how to stop execution in subroutine.
    YOURS
    RAM

  • Sap script perform statement.

    hi all,
       i have a problem with modifying standard sap script form. i have added a field in the line item of my form using perform statement in sap script. but only the corresponding to last line item is getting displayed for all.please help me on this issue my code and sap script is as follows.
    **&      Form  material_wt
         -->IN_TAB     text
         -->OUT_TAB    text
    FORM MATERIAL_WT TABLES in_tab STRUCTURE itcsy
                            out_tab STRUCTURE itcsy.
      DATA : BEGIN OF IT_MAT OCCURS 0,
               ZEILE LIKE J_1IEXCDTL-ZEILE,
               MENGE LIKE J_1IEXCDTL-MENGE,
               MATNR LIKE J_1IEXCDTL-MATNR,
               NTGEW TYPE MARA-NTGEW,
             END OF IT_MAT.
      DATA : V_DOCNO TYPE J_1IEXCDTL-DOCNO,
             V_NTWT TYPE CHAR20.
           READ TABLE in_tab WITH KEY name = 'J_1IEXCDTL-DOCNO'.
           CHECK sy-subrc = c_zero.
           V_DOCNO = in_tab-value.
           SELECT ZEILE MATNR MENGE INTO CORRESPONDING FIELDS OF TABLE IT_MAT FROM J_1IEXCDTL
                                  WHERE DOCNO = V_DOCNO AND TRNTYP = '57FC'.
                   LOOP AT IT_MAT.
                         SELECT SINGLE NTGEW INTO IT_MAT-NTGEW FROM MARA WHERE MATNR = IT_MAT-MATNR.
                   modify it_mat.
                  ENDLOOP.
             loop at it_mat.
                       IF not it_mat[] IS INITIAL.
                       READ TABLE out_tab WITH KEY name =  'NETWT'.
                                  IF sy-subrc = 0.
                                    V_NTWT = IT_MAT-NTGEW * IT_MAT-MENGE.
                                        CONDENSE:V_NTWT.
                                    out_tab-value  =  V_NTWT.
                                    MODIFY out_tab INDEX sy-tabix.
                                  ENDIF.
                        ENDIF.
             endloop.
    endform.
    and my perform statement is as follows,
    /E  ITEM_VALUES
    /:   PERFORM MATERIAL_WT IN PROGRAM ZMM_RPT_CHALLAN
    /:   USING &J_1IEXCDTL-DOCNO&
    /:   CHANGING &NETWT&
    /:   ENDPERFORM
    I1  &J_1IEXCDTL-ZEILE&,,&J_1IEXCDTL-MATNR&,,&NETWT&

    answered

Maybe you are looking for