Hi Regarding subroutines

Hi,
I am upgrading one program from version 4.5b to ecc6.o
in my program
thery are calling onr routine twice, like,
(perform y100_form using p_tab.
perform y100_form using k_post.
form y100_form using p_post structure p_tab.)
and p_tab , k_post are of diffrent structures,
it is working fine in 4.5b
but in 6.0 it throwing error like.
('p_post' is not compatible with 'k_post'.
In Unicode programs 'p_post' must have the same structure layout as 'k_post')
thanks in advance
[email protected]

To use an iTunes Store...
You must be within the Country with a Valid Billing Address and Credit Card for that Country to use the iTunes Store of that Country..
iTunes Store Terms of Service
http://www.apple.com/legal/itunes/us/terms.html#SERVICE

Similar Messages

  • Regarding subroutines

    Hi,
    Can i call an external subroutine from a subroutine....if it possible what is the LOCAL statement's visibility within that external subroutine?
    regards
    subash

    Hi Subash,
    I dont understand this point. Can u elobarate this.
    so if this is the case, the external program should use the
    variable which is declared in that program is taken know?
    What i mean to say is If u have declared some global variables in program2 and u have some subroutine which is using these global variables. If u call this subroutine from program1 then these global variables are visible inside the subroutine but u dont have any data in those variables if they are getting populated outside the routine. If they are populated inside the routine then u dont have any problems.
    Now what ever variables declared in program1 is not visible in program2 subroutine even though u r calling it from program. Bcz ur control will be in program2 till it encounters ENDFORM statement.
    The only way u can use ur program1 variables in program2 is through form interface. U have to pass ur variables/itabs in the PERFORM statement.
    Hope this is clear now.
    Thanks,
    Vinod.

  • Regarding subroutine in script

    hi friends,
    i am calling suroutine in script i write in main window of script this
    /: PERFORM ZVEND IN PROGRAM ZRFI_CONF_SUB
    /: USING &BSIK-LIFNR&
      /:USING &BSIK-BUDAT&
    /:ENDPERFORM .
    i created subroutine pool ZRFI_CONF_SUB.
    but when i am debugging form it is not going in that subroutine
    where i am wrong plz reply me .
    regards,
    sonu

    hi anji,
    i am pesting my code plz plz help me plz go through the code .
    in script
    PERFORM ZVEND IN PROGRAM ZRFI_CONF_SUB
    USING &BSIK-LIFNR&
    USING &BSIK-BUDAT&
    ENDPERFORM
    *& Subroutine pool   ZRFI_CONF_SUB                                            *
    PROGRAM  ZRFI_CONF_SUB.
    DATA : BEGIN OF I_BSID OCCURS 0,
               KUNNR LIKE BSID-KUNNR,
               WRBTR LIKE BSID-WRBTR,
               BUDAT LIKE BSID-BUDAT,
               SHKZG like BSID-shkzg,
               BSTAT LIKE BSID-BSTAT,
           END OF I_BSID.
    DATA : BEGIN OF I_BSAD OCCURS 0,
               KUNNR LIKE BSAD-KUNNR,
               WRBTR LIKE BSAD-WRBTR,
               BUDAT LIKE BSAD-BUDAT,
               SHKZG like BSAD-SHKZG,
               BSTAT LIKE BSAD-BSTAT,
           END OF I_BSAD.
    DATA : BEGIN OF I_BSIK OCCURS 0,
               LIFNR LIKE BSIK-LIFNR,
               WRBTR LIKE BSIK-WRBTR,
               BUDAT LIKE BSIK-BUDAT,
               shkzg like bsik-shkzg,
               BSTAT LIKE BSIK-BSTAT,
           END OF I_BSIK.
    DATA : BEGIN OF I_BSAK OCCURS 0,
               LIFNR LIKE BSAK-LIFNR,
               WRBTR LIKE BSAK-WRBTR,
               BUDAT LIKE BSAK-BUDAT,
               shkzg like bsak-shkzg,
               BSTAT LIKE BSAK-BSTAT,
           END OF I_BSAK.
    *****This is form to get the total in Vendor Bal.ConformationForm*****
    FORM ZVEND TABLES IN_BSIK STRUCTURE ITCSY
                      OUT_BSIK STRUCTURE ITCSY.
      data : year(4),
             month(2),
             day(2),
             date(8).
      DATA : V_AMNT TYPE P DECIMALS 2,
             V_AMT  TYPE P DECIMALS 2,
             V_TOT  TYPE P DECIMALS 2,
             V_TOTAL(20),
             V_LIFNR(10) TYPE N,
             V_BUDAT(10),
             V_WRBTR LIKE BSID-WRBTR.
      READ TABLE IN_BSIK INDEX 1.
      V_LIFNR = IN_BSIK-VALUE.
      READ TABLE IN_BSIK INDEX 2.
      V_BUDAT = IN_BSIK-VALUE.
      year  = V_BUDAT+6(4).
      month = V_BUDAT+3(2).
      day   = V_BUDAT+0(2).
      CONCATENATE year month day into date.
      SELECT LIFNR WRBTR BUDAT SHKZG BSTAT FROM  BSIK
                                           INTO  table I_BSIK
                                           WHERE LIFNR = V_LIFNR.
      SELECT LIFNR WRBTR BUDAT SHKZG BSTAT FROM  BSAK
                                           INTO  table I_BSAK
                                           WHERE LIFNR = V_LIFNR.
      LOOP AT I_BSIK WHERE LIFNR = V_LIFNR.
        if i_bsik-BUDAT <= date and i_bsik-bstat ne 'S'.
          if i_bsik-shkzg = 'S' .
            V_AMNT = V_AMNT + I_BSIK-WRBTR .
          else.
            V_AMNT = V_AMNT - I_BSIK-WRBTR.
          endif.
        endif.
      ENDLOOP.
      LOOP AT I_BSAK WHERE LIFNR = V_LIFNR.
        if i_bsak-BUDAT <= date and i_bsak-bstat ne 'S'.
          if i_bsak-shkzg = 'S'.
            V_AMT = V_AMT + I_BSAK-WRBTR .
          else.
            V_AMT = V_AMT - I_BSAK-WRBTR.
          endif.
        endif.
      ENDLOOP.
      V_TOT = V_AMNT + V_AMT.
      V_TOTAL = V_TOT.
      READ TABLE OUT_BSIK INDEX 1.
      OUT_BSIK-VALUE = V_TOTAL.
      MODIFY  OUT_BSIK INDEX 1.
    ENDFORM.                    "ZVEND
    **This is form to get the total in Customer Bal.Conformation Form*****
    FORM ZCUST TABLES IN_BSID STRUCTURE ITCSY
                      OUT_BSID STRUCTURE ITCSY.
      data : year(4),
             month(2),
             day(2),
             date(8).
      DATA : V_AMNT TYPE P DECIMALS 2,
             V_AMT  TYPE P DECIMALS 2,
             V_TOT  TYPE P DECIMALS 2,
             V_TOTAL(20),
             V_KUNNR(10) type n,
             V_BUDAT(10),
             V_WRBTR LIKE BSID-WRBTR.
      READ TABLE IN_BSID INDEX 1.
      V_KUNNR = IN_BSID-VALUE.
      READ TABLE IN_BSID INDEX 2.
      V_BUDAT = IN_BSID-VALUE.
      year  = V_BUDAT+6(4).
      month = V_BUDAT+3(2).
      day   = V_BUDAT+0(2).
      CONCATENATE year month day into date.
      SELECT KUNNR WRBTR BUDAT SHKZG BSTAT FROM  BSID
                                     INTO  table I_BSID
                                     WHERE KUNNR =  V_KUNNR.
      SELECT KUNNR WRBTR BUDAT SHKZG BSTAT FROM  BSAD
                                     INTO  table I_BSAD
                                     WHERE KUNNR = V_KUNNR.
      LOOP AT I_BSID WHERE KUNNR = V_KUNNR.
        if i_bsid-BUDAT <= date and i_bsid-bstat ne 'S'.
          if i_bsid-shkzg = 'S' .
            V_AMNT = V_AMNT + I_BSID-WRBTR .
          else.
            V_AMNT = V_AMNT - I_BSID-WRBTR.
          endif.
        endif.
      ENDLOOP.
      LOOP AT I_BSAD WHERE KUNNR = V_KUNNR.
        if i_bsad-BUDAT <= date and i_bsad-bstat ne 'S'.
          if i_bsad-shkzg = 'S'.
            V_AMT = V_AMT + I_BSAD-WRBTR .
          else.
            V_AMT = V_AMT - I_BSAD-WRBTR.
          endif.
        endif.
      ENDLOOP.
      V_TOT   = V_AMNT + V_AMT.
      V_TOTAL = V_TOT.
      READ TABLE OUT_BSID INDEX 1.
      OUT_BSID-VALUE = V_TOTAL.
      MODIFY  OUT_BSID INDEX 1.
    ENDFORM.                    "ZCUST

  • Regarding subroutine (Form-EndForm)

    How do I trigger a Subroutine ( It creates a new ticket/insurance claim number/Invoice number) only when print command is given and not when print preview is given so that un-necessarily new ticket/claim/invoice NUMBERS are not generated?

     Hi,
    So it is a script or the smartform ?
    In the sap script you can call the perform as shown below
    You could make a condition to call the below subroutine in sap script window editor.
    Example:  if sy-ucomm = 'PRINT '.
                      perform  TABLES fp_it_intab STRUCTURE itcsy      
                                            fp_it_outtab STRUCTURE itcsy.
    Endform.
     Please let me know if you want the fuction code for print command.
    Edited by: Ashwin Kumar Chitram on Oct 1, 2011 7:21 AM

  • Regarding subroutine pool

    hai friends ,
    i am sorry.the coding has benn changed little bit now.
    the perform in se71 is.
    PERFORM SUB_FORM2 IN PROGRAM ZSSS_NEW
    USING &EKKO-EBELN&
    CHANGING &L_KBERT&
    ENDPERFORM
    FORM sub_form2 TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    TYPES : BEGIN OF ty_itab,
    kschl TYPE konv-kschl,
    kbetr TYPE konv-kbetr,
    END OF ty_itab.
    DATA : t_itab TYPE STANDARD TABLE OF ty_itab,
    wa_itab TYPE ty_itab.
    DATA :
    l_knumv TYPE knumv,
    l_ebeln TYPE ebeln.
    break damlek.
    READ TABLE in_tab WITH KEY name = 'EKKO-EBELN'.
    IF sy-subrc = 0.
    l_ebeln = in_tab-value.
    ENDIF.
    SELECT SINGLE knumv FROM ekko INTO l_knumv WHERE ebeln = l_ebeln.
    if not l_knumv is initial.
    SELECT kschl kbetr
    FROM konv
    INTO corresponding fields of table t_itab
    where knumv = l_knumv.
    endif.
    break damlek.
    if sy-subrc = 0.
    loop at t_itab into wa_itab.
    READ TABLE out_tab with key = 'KONV-KNUMV'.
    out_tab-value = wa_itab-kbetr.
    modify out_tab.
    endif.
    now here upto itab i am gettinfg the value of kbert,but i want to populate it into out_tab so that i can print it in po.
    plz give me the solution.

    Ok,..I think u are populating data into wrong parameter, name should be L_KBERT not KONV-KNUMV.
    Check this modified code:
    PERFORM SUB_FORM2 IN PROGRAM ZSSS_NEW
    USING &EKKO-EBELN&
    CHANGING &L_KBERT&
    ENDPERFORM
    FORM sub_form2 TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    TYPES : BEGIN OF ty_itab,
    kschl TYPE konv-kschl,
    kbetr TYPE konv-kbetr,
    END OF ty_itab.
    DATA : t_itab TYPE STANDARD TABLE OF ty_itab,
    wa_itab TYPE ty_itab.
    DATA :
    l_knumv TYPE knumv,
    l_ebeln TYPE ebeln.
    break damlek.
    READ TABLE in_tab WITH KEY name = 'EKKO-EBELN'.
    IF sy-subrc = 0.
    l_ebeln = in_tab-value.
    ENDIF.
    SELECT SINGLE knumv FROM ekko INTO l_knumv WHERE ebeln = l_ebeln.
    if not l_knumv is initial.
    SELECT kschl kbetr
    FROM konv
    INTO corresponding fields of table t_itab
    where knumv = l_knumv.
    endif.
    break damlek.
    if sy-subrc = 0.
    loop at t_itab into wa_itab.
    READ TABLE out_tab with key name = 'L_KBERT'.
    out_tab-value = wa_itab-kbetr.
    modify out_tab.
    endif.
    Regards,
    Joy.

  • Regarding  subroutine

    Hi i have one repport it contains threeparameters based on the conditions i passed the data to the parameters
    1-parameter dfata is   either bkpf or bus2081
    2-parameter value is data of three fields or twofields(burks belnr gjhar or belnr gjhar)
    3-parameter data is always URL
    my question is how  to put this report in function  as a  form or subroutine and how to pass the values to those parameters based on the conditions in subroutine
    provide the syntax for this subroutine?

    let assume ur FM: get_process_report.
    imp. parameters are:
    p1
    p2
    p3
    write a subroutine
    perform f_get_process using p1 p2 p3.
    double click on f_get_process and save it in ...L(function group)F01.
    endfunction.
    form f_get_process using p1 p2 p3.
    submit report z_Report with p1 with p2 with p3 and return.
    endform.

  • This is regarding subroutines

    Hi,
    I am upgrading one program from version 4.5b to ecc6.o
    in my program
    thery are calling onr routine twice, like,
    (perform y100_form using p_tab.
    perform y100_form using k_post.
    form y100_form using p_post structure p_tab.)
    and p_tab , k_post are of diffrent structures,
    it is working fine in 4.5b
    but in 6.0 it throwing error like.
    ('p_post' is not compatible with 'k_post'.
    In Unicode programs 'p_post' must have the same structure layout as 'k_post')
    thanks in advance
    [email protected]

    The solution is to pass a structure of the same type
    perform y100_form using p_tab.
    data: test_post like p_post.
    move-corresponding k_post to test_post.
    perform y100_form using test_post.
    form y100_form using p_post structure p_tab

  • Regarding Variables declared i n Subroutine

    Hi All,
      Can any body give me information about how to capture the data types of   Variables declared in Subroutine?

    Hi Aruna,
    You can use the DESCRIBE command and get the data type of the variables used in the subrotuines.
    do a F1 help on DESCRIBE <field> command and you will get more details. DESCRIBE command can be used for tables as well as for the fields.
    Cheers
    VJ

  • How to call Subroutines,Standard Text  & using Internal Table in SmartForm

    Hi all,
    need help in the following areas.Its very urgent!
    1.How to CAll Subroutines in Smart Forms
    2.How to CAll Standard Text in Smart Forms
    Situation:
    We have an Internal Table T_SALES with all the data which am going to display in the smartform,How to retrive data from an internal table in Smart forms
    Any Help in this direction would be highly appreciated.
    Regards
    Ramu

    Hi,
      When you are using quantity or currency fields, you have to mentiong the reference fileds in a tab called CURRENCY/QUANTITY FILEDS in the GLOBAL DATA node.
    Specifying a Currency or Quantity Reference
    Use
    In the ABAP Dictionary, you can assign a currency or quantity field to a table field. In the output of these fields, the system can then insert the relevant currency or unit:
    ·        If the value field is in the same table as the corresponding currency or quantity field, the system recognizes the reference automatically, and formats the value field according to the currency or unit in the assigned field.
    ·        If the value field is in a different table from the currency or quantity field, the system cannot recognize this reference automatically.
    In the second case, you must indicate this reference to the system in the form, to ensure that the value field is formatted correctly.
    Procedure
    You want to assign a currency or quantity field in one table (for example, CURTAB) to a value field in another table (for example, VALTAB).
           1.      Create the reference to the currency field by entering the following values:
    -         Field Name: VALTAB-VALUE, if this is the value field of VALTAB that you want to display.
    -         Reference Field: CURTAB-CURRENCY, which is the currency field of CURTAB.
           2.      Under Data Type, specify whether the data type is a currency or quantity.
    Result
    In the output of the PDF-based print form, the system formats the value field VALTAB-VALUE according to the assigned value in the currency or quantity field of the global variable CURTAB-CURRENCY.
    Thanks and Regards,
    Bharat Kumar Reddy.V
    Message was Added by: Bharat Reddy V
    Message was Added by: Bharat Reddy V

  • Structure is not getting filled in the subroutine

    Hi Gurus,
    I'm working on a Z-report ZMB52 for fetching Reserved Stock and showing it in a column.
    The following code in a subroutine I've written for the same.
    DATA: GS_RESB LIKE LINE OF GT_RESB.
        CLEAR: BESTAND.
        IF BESTAND[] IS NOT INITIAL.
          SELECT MATNR
                 BDMNG
            FROM RESB
            INTO TABLE GT_RESB
            FOR ALL ENTRIES IN BESTAND[]
            WHERE MATNR EQ BESTAND-MATNR.
            IF SY-SUBRC EQ 0.
              SORT GT_RESB BY MATNR.
              LOOP AT BESTAND.
               READ TABLE GT_RESB INTO GS_RESB WITH KEY MATNR = BESTAND-MATNR. "BINARY SEARCH.
                 IF SY-SUBRC EQ 0.
                   MODIFY BESTAND TRANSPORTING BDMNG WHERE MATNR = BESTAND-MATNR.
                 ENDIF.
                 CLEAR: BESTAND, GS_RESB.
              ENDLOOP.
            ENDIF.
         ENDIF.
    When I debug, I can see that the structure GS_RESB is not getting filled through the READ TABLE statement. However, GT_RESB shows the data.
    Could you please tell me where am I going wrong and a way to correct it?
    Thanks in Advance!
    Best Regards,
    Ashutosh.

    Hi Joshi
    You can use
    LOOP AT GT_RESB INTO GS_RESB WHERE MATNR = BESTAND-MATNR. "BINARY SEARCH.           
                  MODIFY BESTAND TRANSPORTING BDMNG WHERE MATNR = BESTAND-MATNR.           
                CLEAR: BESTAND, GS_RESB.
    ENDLOOP.
    And please check in debug BESTAND-MATNR .
    Best regards.

  • Regarding Reading contents in classical ALV

    Hi Experts,
    I have a problem in Classical ALV Grid Display.
    I donot know how to read the contents of  modified fields after the grid is displayed.ie. i will modify some cells and press a button which is defined by me then the modified contents need to be read and updated in the data base.i am not able to read those modified contents.so please help me.i am using REUSE_ALV_GRID_DISPLAY.that is my requirement.i cannot use ALV Objects.i am posting the code.please verify and help me.
    REPORT  ZMRMMO_CUSTPOCHANGE.
    *******************************TABLES***************************************
    TABLES : VBAK,   "Sales Document:Header Data.
             VBUK,   "Sales Document:Header Status And Administrative Data.
             VBAP.   "Sales Document:Item Data.
    ********************************TYPES***************************************
    INCLUDE ZPOCHANGE_DECLARATIONS.   "Include Program for declaration part.
    ****************************SELECTION SCREEN********************************
    INCLUDE ZPOCHANGE_SELSCREEN.      "Include Program for selection screen.
    ****************************INITIALIZATION**********************************
    INITIALIZATION.
    COM1 = 'Select Reject Open Sale Order Radio Button To Delete An Open Sale Order'.
    COM2 = 'Select Remove Rejection Radio Button To Undo The Delete sale Order'.
    ****************************START OF SELECTION******************************
    START-OF-SELECTION.
    *CREATE OBJECT obj1.
    PERFORM F_CUSTPOSELECTION. "Subroutine for selection of data from the tables.
    PERFORM F_BUILDFCAT.      "Subroutine To bulid a field catalog.
    *I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    *I_LAYOUT-BOX_TABNAME = 'I_FINAL'.
    *I_LAYOUT-BOX_FIELDNAME = 'X'.
    *APPEND I_LAYOUT.
    PERFORM F_EVENTSGET.
    IF FLAG = 'X'.
    PERFORM F_ALVGRIDDISPLAY. "Subroutine to call the ALV Grid Display Function Module inorder to display the data
    ELSE.
    EXIT.
    ENDIF.
    FORM F_POCHANGEPFSTATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'PO_CHANGE'. "EXCLUDING RT_EXTAB.
    ENDFORM.
    FORM F_POCHNGUSERCOMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.
    RS_SELFIELD-REFRESH = 'X'.
    IF R_UCOMM EQ 'UPD'.
    PERFORM F_POCHANGECHECK." USING RS_SELFIELD.
    ENDIF.
    ENDFORM.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_BUILDF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_POPULF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_ALVGRF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_CUSTPF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_TESTF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_POCHAF01.
    INCLUDE ZMRMMO_CUSTPOCHANGE_F_EVENTF01.
    *&  Include           ZPOCHANGE_DECLARATIONS
    TYPE-POOLS : SLIS.
    TYPES :BEGIN OF TY_VBAK,
           VBELN LIKE VBAK-VBELN,
           BSTNK LIKE VBAK-BSTNK,
           KUNNR LIKE VBAK-KUNNR,
           LIFSK LIKE VBAK-LIFSK,
           GWLDT LIKE VBAK-GWLDT,
           END OF TY_VBAK,
           BEGIN OF TY_VBUK,
           VBELN LIKE VBUK-VBELN,
           LFGSK LIKE VBUK-LFGSK,
           END OF TY_VBUK,
           BEGIN OF TY_VBAP,
           VBELN LIKE VBAP-VBELN,
           LPRIO LIKE VBAP-LPRIO,
           ABGRU LIKE VBAP-ABGRU,
           END OF TY_VBAP,
           BEGIN OF TY_FINAL,
           VBELN LIKE VBAK-VBELN,
           BSTNK LIKE VBAK-BSTNK,
           KUNNR LIKE VBAK-KUNNR,
           LFGSK LIKE VBUK-LFGSK,
           LIFSK LIKE VBAK-LIFSK,
           GWLDT LIKE VBAK-GWLDT,
           LPRIO LIKE VBAP-LPRIO,
           ABGRU LIKE VBAP-ABGRU,
           END OF TY_FINAL.
    ****************************INTERNAL TABLES*********************************
    DATA :I_VBAK TYPE STANDARD TABLE OF TY_VBAK,
          I_VBUK TYPE STANDARD TABLE OF TY_VBUK,
          I_VBAP TYPE STANDARD TABLE OF TY_VBAP,
          I_FINAL TYPE STANDARD TABLE OF TY_FINAL,
          WA_VBAK TYPE TY_VBAK,
          WA_VBUK TYPE TY_VBUK,
          WA_VBAP TYPE TY_VBAP,
          WA_FINAL TYPE TY_FINAL.
    DATA : I_FCAT TYPE SLIS_T_FIELDCAT_ALV,
           I_LAYOUT TYPE SLIS_LAYOUT_ALV, "OCCURS 0,
           WA_FCAT LIKE LINE OF I_FCAT,
          WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
           I_EVENTS TYPE SLIS_T_EVENT,
           WA_EVENTS LIKE LINE OF I_EVENTS,
           I_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
           WA_FCAT1 LIKE LINE OF I_FCAT1.
    *DATA : obj1 TYPE REF TO CL_GUI_ALV_GRID_BASE.
    *DATA :G_ROWNO TYPE I.
    DATA FLAG VALUE 'X'.
    *&  Include           ZPOCHANGE_SELSCREEN
    ****************************SELECTION SCREEN********************************
    SELECTION-SCREEN : BEGIN OF BLOCK SC1 WITH FRAME TITLE TEXT-000.
    PARAMETERS : P_KUNNR TYPE VBAK-KUNNR OBLIGATORY,
                 P_BSTNK TYPE VBAK-BSTNK.
    SELECTION-SCREEN : END OF BLOCK SC1.
    SELECTION-SCREEN : BEGIN OF BLOCK SC2 WITH FRAME TITLE TEXT-001.
    PARAMETERS : R_REMSET RADIOBUTTON GROUP RAD1,
                 R_CNGGAR RADIOBUTTON GROUP RAD1,
                 R_CNGDEL RADIOBUTTON GROUP RAD1,
                 R_REJSO RADIOBUTTON GROUP RAD1,
                 R_REMREJ RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN : COMMENT /1(79) COM1,
                       COMMENT /1(79) COM2.
    SELECTION-SCREEN : END OF BLOCK SC2.
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_CUSTPF01 .
    *&      Form  F_CUSTPOSELECTION
          text
    -->  p1        text
    <--  p2        text
    FORM F_CUSTPOSELECTION .
    IF P_BSTNK IS INITIAL.
      SELECT VBELN BSTNK KUNNR LIFSK GWLDT
             FROM VBAK
             INTO TABLE I_VBAK
             WHERE KUNNR EQ P_KUNNR.
      IF SY-SUBRC <> 0.
        MESSAGE I000(YMES).
        FLAG = '0'.
      ELSE.
        SORT I_VBAK BY VBELN.
      ENDIF.
    ELSE.
      SELECT VBELN BSTNK KUNNR LIFSK GWLDT
             FROM VBAK
             INTO TABLE I_VBAK
             WHERE KUNNR EQ P_KUNNR AND
                   BSTNK EQ P_BSTNK.
      IF SY-SUBRC <> 0.
        MESSAGE I000(YMES).
        FLAG = '0'.
        ELSE.
        SORT I_VBAK BY VBELN.
      ENDIF.
    ENDIF.
    *IF I_VBAK[] IS NOT INITIAL.
    LOOP AT I_VBAK INTO WA_VBAK.
       WRITE :/    WA_VBAK-VBELN,
             10  WA_VBAK-BSTNK,
             20  WA_VBAK-KUNNR,
             30  WA_VBAK-LIFSK,
             40  WA_VBAK-GWLDT.
    ENDLOOP.
    *ENDIF.
    IF I_VBAK[] IS NOT INITIAL.
      SELECT VBELN LFGSK
             FROM VBUK
             INTO TABLE I_VBUK
             FOR ALL ENTRIES IN I_VBAK
             WHERE VBELN = I_VBAK-VBELN AND
                   LFGSK <> 'C'.
    ENDIF.
    IF SY-SUBRC <> 0.
      MESSAGE I000(YMES).
      FLAG = '0'.
    ELSE.
      SORT I_VBUK BY VBELN.
    ENDIF.
    *IF I_VBUK[] IS NOT INITIAL.
    LOOP AT I_VBUK INTO Wa_VBUK.
       WRITE :/ WA_VBUK-VBELN,
             10 WA_VBUK-LFGSK.
    ENDLOOP.
    *ENDIF.
    IF I_VBUK IS NOT INITIAL.
      SELECT VBELN LPRIO ABGRU
             FROM VBAP
             INTO TABLE I_VBAP
             FOR ALL ENTRIES IN I_VBUK
             WHERE VBELN = I_VBUK-VBELN.
    ENDIF.
    IF SY-SUBRC <> 0.
      MESSAGE I000(YMES).
    FLAG = '0'.
    ELSE.
      SORT I_VBAP BY VBELN.
    ENDIF.
    LOOP AT I_VBUK INTO WA_VBUK.
    MOVE :WA_VBUK-VBELN TO WA_FINAL-VBELN,
          WA_VBUK-LFGSK TO WA_FINAL-LFGSK.
    READ TABLE I_VBAK INTO WA_VBAK WITH KEY WA_VBUK-VBELN.
    MOVE :WA_VBAK-BSTNK TO WA_FINAL-BSTNK,
          WA_VBAK-KUNNR TO WA_FINAL-KUNNR,
          WA_VBAK-LIFSK TO WA_FINAL-LIFSK,
          WA_VBAK-GWLDT TO WA_FINAL-GWLDT.
    READ TABLE I_VBAP INTO WA_VBAP WITH KEY WA_VBUK-VBELN.
    MOVE :WA_VBAP-LPRIO TO WA_FINAL-LPRIO,
          WA_VBAP-ABGRU TO WA_FINAL-ABGRU.
    APPEND WA_FINAL TO I_FINAL.
    CLEAR WA_FINAL.
    ENDLOOP.
    ENDFORM.                    " F_CUSTPOSELECTION
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_BUILDF01 .
    *&      Form  F_BUILDFCAT
          text
    -->  p1        text
    <--  p2        text
    FORM F_BUILDFCAT .
    PERFORM F_POPULATE_FCAT USING '1' 'VBELN' 'I_FINAL' '' '' '10' 'Sales Document' 'VBELN' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '2' 'BSTNK' 'I_FINAL' '' '' '10' 'Customer PO No.' 'BSTNK' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '3' 'KUNNR' 'I_FINAL' '' 'X' '10' 'Sold-to Party' 'KUNNR' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '4' 'LFGSK' 'I_FINAL' '' '' '1' 'Delivery Status' 'LFGSK' 'VBUK'.
    CASE 'X'.
    WHEN R_REMSET.
    PERFORM F_POPULATE_FCAT USING '5' 'LIFSK' 'I_FINAL' '' '' '2' 'Delivery BlocK' 'LIFSK' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '6' 'LIFSK' 'I_FINAL' 'X' '' '2' 'Present Delivery BlocK' 'LIFSK' 'VBAK'.
    WHEN R_CNGGAR.
    PERFORM F_POPULATE_FCAT USING '5' 'GWLDT' 'I_FINAL' '' '' '8' 'Guarantee Date' 'GWLDT' 'VBAK'.
    PERFORM F_POPULATE_FCAT USING '6' 'GWLDT' 'I_FINAL' 'X' '' '8' 'Present Guarantee Date' 'GWLDT' 'VBAK'.
    WHEN R_CNGDEL.
    PERFORM F_POPULATE_FCAT USING '5' 'LPRIO' 'I_FINAL' '' '' '2' 'Delivery Priority' 'LPRIO' 'VBAP'.
    PERFORM F_POPULATE_FCAT USING '6' 'LPRIO' 'I_FINAL' 'X' '' '2' 'Present Delivery Priority' 'LPRIO' 'VBAP'.
    WHEN R_REJSO.
    PERFORM F_POPULATE_FCAT USING '5' 'ABGRU' 'I_FINAL' '' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    PERFORM F_POPULATE_FCAT USING '6' 'ABGRU' 'I_FINAL' 'X' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    WHEN R_REMREJ.
    PERFORM F_POPULATE_FCAT USING '5' 'ABGRU' 'I_FINAL' '' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    PERFORM F_POPULATE_FCAT USING '6' 'ABGRU' 'I_FINAL' 'X' '' '2' 'Reason For Rejection' 'ABGRU' 'VBAP'.
    ENDCASE.
    ENDFORM.                    " F_BUILDFCAT
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_EVENTF01 .
    *&      Form  F_EVENTSGET
          text
    -->  p1        text
    <--  p2        text
    FORM F_EVENTSGET .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = I_EVENTS
    EXCEPTIONS
       LIST_TYPE_WRONG       = 1
       OTHERS                = 2
    IF SY-SUBRC <> 0.
    SORT I_EVENTS BY NAME.
    ENDIF.
    *READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'USER_COMMAND'.
    *IF SY-SUBRC = 0.
    *MOVE 'USER_COMMAND' TO WA_EVENTS-FORM.
    *MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX."TRANSPORTING FORM WHERE NAME = 'WA_EVENT-NAME'.
    *ENDIF.
    READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'LIST_MODIFY'.
    IF SY-SUBRC = 0.
    MOVE 'LIST_MODIFY' TO WA_EVENTS-FORM.
    MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
    ENDIF.
    *READ TABLE I_EVENTS INTO WA_EVENTS WITH KEY NAME = 'PF_STATUS_SET'.
    *IF SY-SUBRC = 0.
    *MOVE 'PF_STATUS_SET' TO WA_EVENTS-FORM.
    *MODIFY I_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
    *ENDIF.
    ENDFORM.                    " F_EVENTSGET
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_ALVGRF01 .
    *&      Form  F_ALVGRIDDISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM F_ALVGRIDDISPLAY .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                =  SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'F_POCHANGEPFSTATUS'
       I_CALLBACK_USER_COMMAND           = 'F_POCHNGUSERCOMMAND'
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = I_LAYOUT
       IT_FIELDCAT                       = I_FCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
       I_SAVE                            = 'U'
      IS_VARIANT                        =
       IT_EVENTS                         = I_EVENTS
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = I_FINAL
    EXCEPTIONS
       PROGRAM_ERROR                     = 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.
    *CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DATA_GET'
    EXPORTING
       I_HEADER_TABNAME       =
       I_ITEM_TABNAME         =
    IMPORTING
      ET_FIELDCAT            =
      ET_SORT                =
    EXCEPTIONS
      PROGRAM_ERROR          = 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.
    ENDFORM.                    " F_ALVGRIDDISPLAY
    ***INCLUDE ZMRMMO_CUSTPOCHANGE_F_POCHAF01 .
    *&      Form  F_POCHANGECHECK
          text
    -->  p1        text
    <--  p2        text
    FORM F_POCHANGECHECK.
    ENDFORM.                    " F_POCHANGECHECK

    Hi
    I sure that there is a better way,but this one will work also...
    In PBO enter rows you will show in report to itab you define (same type)
    In PAI (after change) compare this tables (your grid table and itab with values before the change) and you will get rows which have been changed...
    REGARDS
    Yossi

  • Regarding Internal table and access performance

    hey guys.
    In my report , Somehow i reduced the query performance time by selecting minimum key fields and moved the selected records to internal table.
    Now from this internal table i am restricting the loop
    as per my requirements using where statements.(believing that internal table retrieval is more faster than database acces(using query)).
    But still my performance goes down.
    Could you pls suggest me how to reduce the execution time
    in abap programming.
    I used below commands.
    Read using binary search.
    loop ...where statement.
    perform statements.
    collect staements.
    delete itab.(delete duplicates staements too)
    sort itab(sorting).
    For each above statements do we have any faster way to retrieval records.
    If i see my bottle neck at se30.it shows
    ABAP programming to 70 percent
    database access to 20 percent
    R3 system as 10percent.
    now how to reduce this abap process.
    could you pls reply.
    ambichan.
    ambichan.

    Hello Ambichan,
    It is difficult to suggest the improvements without looking at the actual code that you are running. However, I can give you some general information.
    1. READ using the BINARY SEARCH addition.
    This is indeed a good way of doing a READ. But have you made sure that the internal table is <i>sorted by the required fields</i> before you use this statement ?
    2. LOOP...WHERE statement.
    This is also a good way to avoid looping through unnecessary entries. But further improvement can certainly be achieved if you use FIELD-SYMBOLS.
    LOOP AT ITAB INTO <FIELD_SYMBOL_OF_THE_SAME_LINE-TYPE_AS_ITAB>.
    ENDLOOP.
    3. PERFORM statements.
    A perform statement can not be optimized. what matters is the code that you write inside the FORM (or a subroutine).
    4. COLLECT statements.
    I trust you have used the COLLECT statement to simplify the logic. Let that be as it is. The code is more readable and elegant.
    The COLLECT statement is somewhat performance intensive. It takes more time with a normal internal table (STANDARD). See if you can use an internal table of type  SORTED. Even better, you can use a HASHED internal table.
    5. DELETE itab.(delete duplicates staements too)
    If you are making sure that you are deleting several entries based on a condition, then this should be okay. You cannot avoid using the DELETE statement if your functionality requires you to do so.
    Also, before deleting the DUPLICATES, ensure that the internal table is sorted.
    6. SORT statement.
    It depends on how many entries there are in the internal table. If you are using most of the above points on the same internal table, then it is better that you define your internal table to be of type SORTED. That way, inserting entries will take a little more time (to ensure that the table is always sorted), but alll the other operations are going to be much faster.
    Get back to me if you need further assistance.
    Regards,
    <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=zwcc%2fwm4ups%3d">anand Mandalika</a>.

  • Query regarding passing of an internal table data to a form

    Hi All,
    Please help me out regardingmy query.
    I have a standard driver program and a Z form(SAPSCRIPT). Suppose i have an RFQ and it has number of line items in it, I need to fetch them all for a RFQ and then pass to the form and as this functionality is not available in the driver program, i want to  achieve via a subroutine pool. Passing of the data via the itcsy structure and all or by calling a write_form and passing the element to it.
    Can u all let me know whether i can pass the data ie., multipe records of data to form from a program otehr than the driver program?
    Regards
    Priya

    Hi Priya,
                  Why you need separate subroutine, you will find all the required data in the driver program itself.
    Just identify the Standard Subroutine in NACE tcode,
    For all Standard Driver program is SAPFM06P
    For RFQ
    Application type is 'EA'
    Output types are
    1) New
    2) Reminder
    3) Quotation rejection
    Further standard subroutines used for each output type are
    1)ENTRY_NEU  -  New
    2)ENTRY_MAHN - Reminder
    3)ENTRY_ABSA - Quotation rejection
    and the above mentioned subroutines get the data required for the corresponding sapscript
    RFQ Docno :- ekpo-ebeln
    RFQ Item   :- ekpo-ebelp
    Regards
    Bala Krishna

  • Error while sending data to a subroutine in script

    Hi,
      While passing a currency field for calculation to a subroutine through perform statement iam getting runtime error saying "unable ti interpret 5000.00 as a number. 5000.00 is nothing but the first currency value which iam sending for calculation.in the code the error is raised on the bold line .
    rf140-wrshb has value 5000.00 .the code which i have written in subroutine is as follows.
    READ TABLE I_IN WITH KEY NAME = 'RF140-WRSHB'.
    MOVE I_IN-VALUE TO LV_SUM1. 
    CLEAR I_IN.
    DATA: SUM_C TYPE N.
      SUM1 = SUM1 + LV_SUM1.
      READ TABLE I_OUT WITH KEY NAME = 'LV_BALANCE'.
    MOVE SUM1 TO I_OUT-VALUE.
      MODIFY I_OUT TRANSPORTING VALUE WHERE NAME = 'LV_BALANCE'.
      CLEAR I_OUT.
    lv_balance is the one which receives the output value.
    can anyone tell me what is the mistake i have done nd how to rectify it.
    Thanks,
    Rose.

    Hi,
    I have done something similar so below is the code while passing currency fields to subroutines:
    Actually I was retrieving 2 fields from scripts and then substract them and then send back the result to the script. Hope it works out for you, try it out and REWARD POINTS IF HELPFUL!! (also for your prev post!!)
    FORM get_pay TABLES in_tab STRUCTURE itcsy out_tab STRUCTURE itcsy.
      DATA: lv_var(255)  TYPE c, "dmbtr,
            lv_var1(255) TYPE c, "qsshb,
            lv_var2(255) TYPE c, "dmbtr.
            var(20) TYPE c,
            var1(25) TYPE c,
            var2(25) TYPE c,
            var3(25) TYPE c,
            var4(25) TYPE c,
            var5(25) TYPE c,
            var6(25) TYPE c,
            vari TYPE ztemp,
            vari2 TYPE ztemp,
            vari3 TYPE ztemp.
      DATA: lv_var4 TYPE dmbtr,
            lv_var5 TYPE qsshb,
            lv_var6 TYPE dmbtr,
            len TYPE i,
            len1 TYPE i,
            dot TYPE c.
      READ TABLE in_tab WITH KEY 'REGUP-DMBTR'.
      IF sy-subrc EQ 0.
        lv_var = in_tab-value.
        len = STRLEN( lv_var ).
        len1 = len - 3.
        dot = lv_var+len1(1).
        IF dot = ','.
          SPLIT lv_var AT ',' INTO var1 var2.
          REPLACE '.' IN var1 WITH ','.
          CONCATENATE '.' var2 INTO var2.
          CONCATENATE var1 var2 INTO var.
          CONDENSE var.
          vari = var1.
          SHIFT vari LEFT DELETING LEADING '0'.
          CONCATENATE vari var2 INTO vari.
          lv_var4 = vari.
        ELSE.
          SPLIT lv_var AT '.' INTO var1 var2.
          REPLACE '.' IN var1 WITH ','.
          CONCATENATE '.' var2 INTO var2.
          CONCATENATE var1 var2 INTO var.
          CONDENSE var.
          vari = var1.
          SHIFT vari LEFT DELETING LEADING '0'.
          CONCATENATE vari var2 INTO vari.
          lv_var4 = vari.
        ENDIF.
        CLEAR: dot, len, len1.
      ENDIF.
      lv_var = vari.
      CALL FUNCTION 'CHAR_NUMC_CONVERSION'
        EXPORTING
          input   = lv_var
        IMPORTING
          numcstr = lv_var4.
      READ TABLE in_tab WITH KEY 'REGUP-QBSHB'.
      IF sy-subrc EQ 0.
        lv_var1 = in_tab-value.
        len = STRLEN( lv_var1 ).
        len1 = len - 3.
        dot = lv_var1+len1(1).
        IF dot = ','.
          SPLIT lv_var1 AT ',' INTO var3 var4.
          REPLACE '.' IN var3 WITH ','.
          CONCATENATE '.' var4 INTO var4.
          CONDENSE var.
          vari2 = var3.
          SHIFT vari2 LEFT DELETING LEADING '0'.
          CONCATENATE vari2 var4 INTO vari2.
          lv_var6 = vari2.
        ELSE.
          SPLIT lv_var1 AT '.' INTO var3 var4.
          REPLACE '.' IN var3 WITH ','.
          CONCATENATE '.' var4 INTO var4.
          CONDENSE var.
          vari2 = var3.
          SHIFT vari2 LEFT DELETING LEADING '0'.
          CONCATENATE vari2 var4 INTO vari2.
          lv_var6 = vari2.
        ENDIF.
        CLEAR: dot, len, len1.
      ENDIF.
      lv_var1 = vari2.
      CALL FUNCTION 'CHAR_NUMC_CONVERSION'
        EXPORTING
          input   = lv_var1
        IMPORTING
          numcstr = lv_var6.
      lv_var5 = lv_var4 - lv_var6.
      lv_var2 = lv_var5.
      var = lv_var5.
      WRITE lv_var5 TO var CURRENCY 'SG'.
      READ TABLE out_tab WITH KEY 'LV_PAY'.
      IF sy-subrc EQ 0.
        out_tab-value = var.
        MODIFY out_tab INDEX 1.
      ENDIF.
    ENDFORM.                    "get_PAY
    Regards,
    Narendra.

  • Error in subroutine READ_NAMTB

    Hi,
    While posting an idoc through the test tool WE19, we are encountering an error  'Error in subroutine READ_NAMTB for structure of infotype'. We are using the extended idoc type ZRMD_A06 with a custom segment containing the PERNR and some other details.
    Are we missing out on something?Please advise!
    Thanks in advance!
    Regards,
    Nejuma Iqbal

    Hello Neujuma Iqbal
    Have you already found a solution to this problem?
    If yes, could you please tell me?
    thanks + regards
    Paul Züllig
    mail: [email protected]

Maybe you are looking for

  • Java edition compatible with standard edition?

    Hi I have a database created using Java edition 3.2.44 I want to write an application in C++ which reads this database using the standard Berkeley DB (possibly at the same time as the java application is also accessing them). Are the database files c

  • In-Place Hold Combined with In-Place Archiving in Exchange 2013

    Hi, In-Place Hold is enabled for a mailbox and set to keep everything indefinitely.  The same mailbox has a Retention Policy with a Default Policy Tag set to move everything to an archive mailbox after 2 years. Let's say the user keeps mail in the pr

  • New VAT Cess introduced in Kerala state - India

    Dear Experts, There is a new VAT Cess of 1 % introduced in the state of Kerala- India. As per this tax of 1% we tried after creating one new condition type as JISC and assigned it to JVRD (4% Input VAT RM Deductible). We also created one seperate tax

  • Issue in using ATRV () Function

    Hi All, I have a FOX Code in which i am trying to populate 0PROFIT_CTR which is the attribute of the master data, YCSTATMCG. I tried to use the ATRV Function, but it doesnt seem to be working. My code is as below: DATA V_ATCP TYPE YCSTATMCG. DATA V_P

  • Stupid question i know...

    I'm having troubles importing anything into DVD Studio Pro. What format do movies need to be in, and can that be exported from iMovie '09?