HELP ME IN OKCODE

HI ALL,
         HOW TO FIND OKCODE FOR A PARTICULAR BUTTONS IN THE MENUBAR,APP TOOL BAR AND STANDARD TOOL BAR?
WITH WARM REGARDS,
KHADAR.

Hi,
you can find in a Simple ways,
1) Just enter /H(Debugging) in the Command bar and press the button, then it will goes to debugging mode, see the Sy-UCOMM there, you will fidn the Ok Code
2) Goto SE51 and enter the program name and the Screen No and see the Attributes of that button, there you will fidn the OK_Code
3) In Scrren press that button and hold it and press F1.
Regards
Sudheer

Similar Messages

  • Error Fixing..please help me..full marks wud be given........

    I am getting a following error when i run the program in ECC 6.o
    ERROR:" The where condition does not refer to for all entries table..
    program is as follows..full marks wud be given.....
    ***INCLUDE MZSDRETL_RMP_PRICING_ENTRYF01 .
    *&      Form  COMPUTE_SCROLLING_IN_TC
    Vertical Scrolling in table control upon pressing , next page,
    previous page , first page and last page button
         -->P_TC_NAME   table control name
         -->P_OK_CODE   okcode
         -->P_LOOPC     current loop count
    FORM COMPUTE_SCROLLING_IN_TC USING    P_TC_NAME
                                          P_OK_CODE
                                          P_LOOPC.
    -BEGIN OF LOCAL DATA----
      DATA L_TC_NEW_TOP_LINE    LIKE SY-TABIX.
      DATA L_TC_FIELD_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
    -END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
      IF <TC>-LINES = 0.
        L_TC_NEW_TOP_LINE = 1.
      ELSE.
        CALL FUNCTION 'SCROLLING_IN_TABLE'
             EXPORTING
                  ENTRY_ACT      = <TC>-TOP_LINE
                  ENTRY_FROM     = 1
                  ENTRY_TO       = <TC>-LINES
                  LAST_PAGE_FULL = C_X
                  LOOPS          = P_LOOPC
                  OK_CODE        = P_OK_CODE
                  OVERLAPPING    = C_X
             IMPORTING
                  ENTRY_NEW      = L_TC_NEW_TOP_LINE.
            exceptions
                 no_entry_or_page_act  = 01
                 no_entry_to           = 02
                 no_ok_code_or_page_go = 03
                 others                = 99.
      ENDIF.
    get actual tc and column                                             *
      GET CURSOR FIELD L_TC_FIELD_NAME .
      IF SY-SUBRC = 0.
        set actual column                                                *
        SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
      ENDIF.
    set the new top line                                                 *
      <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM.                    " COMPUTE_SCROLLING_IN_TC
    *&      Form  GET_VALUE_ON_REQUEST
    Call function module to display the region list in form of search help
    FORM GET_VALUE_ON_REQUEST TABLES RET
                              USING    P_C_RET
                                       P_C_DYN
                                       P_DYNNR.
    Call function module to display the data in internal table in form of
    a search help
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                RETFIELD    = P_C_RET
                DYNPPROG    = G_REPID
                DYNPNR      = P_DYNNR
                DYNPROFIELD = P_C_DYN
                VALUE_ORG   = C_VAL_ORG  " Value S
           TABLES
                VALUE_TAB   = RET.
      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.                    " GET_VALUE_ON_REQUEST
    *&      Form  POPULATE_RANGES
          Populate range tables with store grouping data
         -->P_I_STORE_INFO  store grouping entry
    FORM POPULATE_RANGES USING L_REGION_ID
                               L_DIST_ID
                               L_AREA_ID
                               L_STORE_ID.
      CLEAR : R_REGION , R_DIST , R_AREA , R_STORE .
      CLEAR : R_REGION[] , R_DIST[] , R_AREA[] , R_STORE[].
    populate region
      IF NOT L_REGION_ID IS INITIAL.
        R_REGION-SIGN = C_SIGN.
        R_REGION-OPTION = C_OPT1.
        R_REGION-LOW = L_REGION_ID.
        APPEND R_REGION.
        CLEAR R_REGION.
      ENDIF.
    populate district
      IF NOT L_DIST_ID IS INITIAL.
        R_DIST-SIGN = C_SIGN.
        R_DIST-OPTION = C_OPT1.
        R_DIST-LOW = L_DIST_ID.
        APPEND R_DIST.
        CLEAR R_DIST.
      ENDIF.
    populate area
      IF NOT L_AREA_ID IS INITIAL.
        R_AREA-SIGN = C_SIGN.
        R_AREA-OPTION = C_OPT1.
        R_AREA-LOW = L_AREA_ID.
        APPEND R_AREA.
        CLEAR R_AREA.
      ENDIF.
    populate store
      IF NOT L_STORE_ID IS INITIAL.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = L_STORE_ID
             IMPORTING
                  OUTPUT = L_STORE_ID.
        R_STORE-SIGN = C_SIGN.
        R_STORE-OPTION = C_OPT1.
        R_STORE-LOW = L_STORE_ID.
        APPEND R_STORE.
        CLEAR R_STORE.
      ENDIF.
    ENDFORM.                    " POPULATE_RANGES
    *&      Form  GET_TABLE_ROW_VALUES
      Get the field values of the current row of the table
      l_stepl - current row no.
    FORM GET_TABLE_ROW_VALUES USING L_STEPL.
      DATA: L_REPID LIKE D020S-PROG.
      REFRESH I_DYNPREAD.
      WA_DYNPREAD-STEPL = L_STEPL.
      WA_DYNPREAD-FIELDNAME = 'I_STORE_INFO-REGION_ID'.
      APPEND WA_DYNPREAD TO I_DYNPREAD.
      CLEAR WA_DYNPREAD.
      WA_DYNPREAD-STEPL = L_STEPL.
      WA_DYNPREAD-FIELDNAME = 'I_STORE_INFO-DIST_ID'.
      APPEND WA_DYNPREAD TO I_DYNPREAD.
      CLEAR WA_DYNPREAD.
      WA_DYNPREAD-STEPL = L_STEPL.
      WA_DYNPREAD-FIELDNAME = 'I_STORE_INFO-AREA_ID'.
      APPEND WA_DYNPREAD TO I_DYNPREAD.
      CLEAR WA_DYNPREAD.
      WA_DYNPREAD-STEPL = L_STEPL.
      WA_DYNPREAD-FIELDNAME = 'I_STORE_INFO-ATTR_VAL'.
      APPEND WA_DYNPREAD TO I_DYNPREAD.
      CLEAR WA_DYNPREAD.
      WA_DYNPREAD-STEPL = L_STEPL.
      WA_DYNPREAD-FIELDNAME = 'I_STORE_INFO-STORE_ID'.
      APPEND WA_DYNPREAD TO I_DYNPREAD.
      CLEAR WA_DYNPREAD.
      WA_DYNPREAD-STEPL = L_STEPL.
      WA_DYNPREAD-FIELDNAME = 'ZPRICELIST-ZLIST'.
      APPEND WA_DYNPREAD TO I_DYNPREAD.
      CLEAR WA_DYNPREAD.
      L_REPID = G_REPID .
    Call function to get the screen data
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME     = L_REPID
                DYNUMB     = SY-DYNNR
           TABLES
                DYNPFIELDS = I_DYNPREAD.
      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.                    " GET_TABLE_ROW_VALUES
    *&      Form  DETERMINE_LEVEL
    Determine the level of store grouping info entered
        Region                  - 1
        Region/Dist             - 2
        Region/Dist/Area        - 3
        Region/Dist/Area/Store  - 4
    FORM DETERMINE_LEVEL USING    P_I_STORE_INFO LIKE I_STORE_INFO.
      IF NOT P_I_STORE_INFO-REGION_ID IS INITIAL
         AND P_I_STORE_INFO-DIST_ID IS INITIAL
         AND P_I_STORE_INFO-AREA_ID IS INITIAL
         AND P_I_STORE_INFO-STORE_ID IS INITIAL.
        P_I_STORE_INFO-LEVEL = C_LEVEL1.
      ENDIF.
      IF NOT P_I_STORE_INFO-REGION_ID IS INITIAL
         AND NOT P_I_STORE_INFO-DIST_ID IS INITIAL
         AND P_I_STORE_INFO-AREA_ID IS INITIAL
         AND P_I_STORE_INFO-STORE_ID IS INITIAL.
        P_I_STORE_INFO-LEVEL = C_LEVEL2.
      ENDIF.
      IF NOT P_I_STORE_INFO-REGION_ID IS INITIAL
         AND NOT P_I_STORE_INFO-DIST_ID IS INITIAL
         AND  NOT P_I_STORE_INFO-AREA_ID IS INITIAL
         AND P_I_STORE_INFO-STORE_ID IS INITIAL.
        P_I_STORE_INFO-LEVEL = C_LEVEL3.
      ENDIF.
      IF NOT P_I_STORE_INFO-REGION_ID IS INITIAL
         AND NOT P_I_STORE_INFO-DIST_ID IS INITIAL
         AND NOT P_I_STORE_INFO-AREA_ID IS INITIAL
         AND NOT P_I_STORE_INFO-STORE_ID IS INITIAL.
        P_I_STORE_INFO-LEVEL = C_LEVEL4.
      ENDIF.
    ENDFORM.                    " DETERMINE_LEVEL
    *&      Form  GET_SY_STEPL
        Get the current record number in the table control.
         -->P_L_STEPL  text
    FORM GET_SY_STEPL USING    P_L_STEPL LIKE SY-STEPL.
      CLEAR P_L_STEPL.
      CALL FUNCTION 'DYNP_GET_STEPL'
          IMPORTING
               POVSTEPL        = P_L_STEPL
       EXCEPTIONS
            STEPL_NOT_FOUND = 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.                    " GET_SY_STEPL
    *&      Form  GET_POPUP_CONFIRM
          Display the popup to confirm the user
    FORM GET_POPUP_CONFIRM USING    P_L_ANS
                                    P_G_POPUP_TEXT
                                    G_LINE_TEXT.
      CALL FUNCTION 'POPUP_TO_CONFIRM'
           EXPORTING
                TITLEBAR      = G_LINE_TEXT
                TEXT_QUESTION = P_G_POPUP_TEXT
           IMPORTING
                ANSWER        = P_L_ANS.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " GET_POPUP_CONFIRM
    *&      Form  GOTO_SKU_HIER_SCREEN
    Upon user wishes to go to the detail screen , a check is performed
    to determine if any existing promo or pricing is already available
    for the entered store grouping info . If it is available then
    prompt a message to the user 'Already promo exists if  user wants to
    go to the detail screen ?'. If the user presses 'Yes' then then
    detail screen will appear otherwise the header screen will appear
    FORM GOTO_SKU_HIER_SCREEN.
      CLEAR G_CHECK_ENTRY.
    Check the store grouping entries beforr switching to detail screen.
      PERFORM CHECK_STORE_ENTRIES.
      CHECK G_CHECK_ENTRY IS INITIAL.
      READ TABLE I_STORE_INFO WITH KEY REGION_ID = C_SPACE
                                       DIST_ID = C_SPACE
                                       AREA_ID = C_SPACE
                                       STORE_ID = C_SPACE
                                       ATTR_VAL = C_SPACE.
      IF SY-SUBRC = 0.
        DELETE I_STORE_INFO WHERE  REGION_ID = C_SPACE
                            AND    DIST_ID = C_SPACE
                            AND    AREA_ID = C_SPACE
                            AND    STORE_ID = C_SPACE
                            AND    ATTR_VAL = C_SPACE.
      ENDIF.
    perform check for the duplicate store grouping data.
      PERFORM CHECK_DUPLICATE_STRGRP_DATA.
    If any duplicate entry is found then user will be prompted with the
    message if he/she wants to delete those duplicate entries . If 'Yes'
    is pressed then all the duplicate entries will be deleted or else
    if 'No' is pressed , then user will remain in the same header screen
      IF    G_DUPLICATE_ENTRY = C_X.
        CONCATENATE TEXT-058 TEXT-059
        INTO   G_POPUP_TEXT
        SEPARATED BY SPACE.
        CLEAR G_ANS.
        CLEAR G_LINE_TEXT.
    Get the pop-up to confirm the operation
        PERFORM GET_POPUP_CONFIRM USING G_ANS
                                        G_POPUP_TEXT
                                        G_LINE_TEXT.
        IF G_ANS = '1'.
    Delete the duplicate entries
          DELETE ADJACENT DUPLICATES FROM I_STORE_INFO COMPARING REGION_ID
                                                                 DIST_ID
                                                                 AREA_ID
                                                                 STORE_ID
                                                                 ATTR_VAL.
          MESSAGE S161(ZS) WITH TEXT-003.
        ENDIF.
      ELSE.
    Perform the duplicate entry check for create or change pricing
        IF G_MAIN_OKCODE = 'PRCC' OR G_MAIN_OKCODE = 'CRPR'.
          IF I_STORE_INFO[] IS INITIAL.
            MESSAGE S161(ZS) WITH TEXT-004.
          ELSE.
            CLEAR G_FLAG.
            LOOP AT I_STORE_INFO WHERE NOT REPROMO IS INITIAL.
              G_FLAG = C_X.
              EXIT.
            ENDLOOP.
    Prompt the message by calling the function module for pop-up confirm
            IF NOT G_FLAG IS INITIAL.
              CONCATENATE TEXT-061 TEXT-062
                           INTO G_POPUP_TEXT SEPARATED BY SPACE .
              CLEAR G_LINE_TEXT.
              PERFORM GET_POPUP_CONFIRM USING G_ANS
                                              G_POPUP_TEXT
                                              G_LINE_TEXT.
              IF G_ANS = C_ANS1.
                CLEAR G_ANS.
                PERFORM EXISTING_SKU_BEFORE_DETAIL_SCR.
    Begin of DEVK939178
    Set top line of sku table to 1 and resolve nested screen calls
                TBCL3-TOP_LINE = 1.
               call screen 9002.
                LEAVE TO SCREEN 9002.
    End of DEVK939178
              ENDIF.
            ELSE.
              PERFORM EXISTING_SKU_BEFORE_DETAIL_SCR.
    Begin of DEVK939178
    Set top line of sku table to 1 and resolve nested screen calls
              TBCL3-TOP_LINE = 1.
              LEAVE TO SCREEN 9002.
             call screen 9002.
    End of DEVK939178
            ENDIF.
          ENDIF.
        ELSE.
    If user does not input any store grouping info in the header screen
    and opts to go to the detail, then message will appear to the user as
    'A Promo is going to be applied on the Price List type '. This will
    necessarily be a % promo as the promo is going to applied across all
    the SKUs that belong to that price list type which is irrespective of
    the price of individual SKUs
          IF I_STORE_INFO[] IS INITIAL.
            IF G_PRICING_VIEW_FLAG = C_X       " DEVK939197
              OR G_PROMO_VIEW_FLAG = C_X.      " DEVK939197
              LEAVE TO SCREEN 9002.
            ELSE.
              IF G_PROMO_PLTYP <> C_X.
                CLEAR G_POPUP_TEXT.
                CLEAR G_LINE_TEXT.
                CONCATENATE TEXT-063 TEXT-062
                             INTO G_POPUP_TEXT SEPARATED BY SPACE .
                PERFORM GET_POPUP_CONFIRM USING G_ANS
                                                G_POPUP_TEXT
                                                G_LINE_TEXT.
                IF G_ANS = C_ANS1.
    If user opts 'Yes' then another screen will appear where the user can
    give the value of the % promo that is going to be applied on the
    pricelist type
                  G_PROMO_PLTYP = C_X.
    Begin of DEVK939178
    Set top line of sku table to 1 and resolve nested screen calls
                  CLEAR I_STORE_INFO.
                  I_STORE_INFO-LEVEL = C_LEVEL6.
                  APPEND I_STORE_INFO.
                  TBCL3-TOP_LINE = 1.
                  PERFORM CHECK_EXIST_PROMO_STR .
                  PERFORM EXISTING_SKU_BEFORE_DETAIL_SCR.
                  LEAVE TO SCREEN 9002.
               call screen 9002.
    End of DEVK939178
             call screen 9006 starting at 10 5 ending at 70 10.
                ELSE.
                  MESSAGE S161(ZS) WITH TEXT-004.
                ENDIF.
              ENDIF.
            ENDIF.
          ELSE.
            CLEAR G_FLAG.
            LOOP AT I_STORE_INFO WHERE NOT REPROMO IS INITIAL.
              G_FLAG = 'X'.
              EXIT.
            ENDLOOP.
            IF NOT G_FLAG IS INITIAL.
              CONCATENATE TEXT-064 TEXT-062
                           INTO G_POPUP_TEXT SEPARATED BY SPACE .
              CLEAR G_LINE_TEXT.
              PERFORM GET_POPUP_CONFIRM USING G_ANS
                                              G_POPUP_TEXT
                                              G_LINE_TEXT.
              IF G_ANS = C_ANS1.
                CLEAR G_ANS.
                PERFORM EXISTING_SKU_BEFORE_DETAIL_SCR.
    Begin of DEVK939178
    Set top line of sku table to 1 and resolve nested screen calls
                TBCL3-TOP_LINE = 1.
                LEAVE TO SCREEN 9002.
               call screen 9002.
    End of DEVK939178
              ENDIF.
            ELSE.
              PERFORM EXISTING_SKU_BEFORE_DETAIL_SCR.
    Begin of DEVK939178
    Set top line of sku table to 1 and resolve nested screen calls
              TBCL3-TOP_LINE = 1.
              LEAVE TO SCREEN 9002.
             call screen 9002.
    End of DEVK939178
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    *endif.
    ENDFORM.                    " GOTO_SKU_HIER_SCREEN
    *&      Form  ADD_LINE_STR_GRP
          Add new entry to the store gropuing info
    FORM ADD_LINE_STR_GRP.
      G_OKCODE = OKCODE.
      CLEAR I_STORE_INFO.
      DESCRIBE TABLE I_STORE_INFO LINES L_LINE.
      DO 15 TIMES.
        I_STORE_INFO-LEVEL = C_LEVEL0.
        APPEND I_STORE_INFO.
        CLEAR I_STORE_INFO.
      ENDDO.
      G_ADD_CNT = G_ADD_CNT + 15.
      G_LINE_CNT = 1.
    ENDFORM.                    " ADD_LINE_STR_GRP
    *&      Form  DELETE_LINE_STR_GRP
    Delete selected entries which the user wants to perform a
    delete operation .
    FORM DELETE_LINE_STR_GRP.
    If the store grouping table is blank then issue message
    'No Entry is available for Selection.' .
      IF I_STORE_INFO[] IS INITIAL.
        MESSAGE S161(ZS) WITH TEXT-001.
      ELSE.
    Check if any entry in the store info table is checked for the delete
    If selected, then issue a confirmation message to the user in pop-up
        READ TABLE I_STORE_INFO WITH KEY SEL = C_X.
        IF SY-SUBRC = 0.
          CLEAR G_POPUP_TEXT.
          CLEAR G_LINE_TEXT.
          G_POPUP_TEXT =  TEXT-065 .
          PERFORM GET_POPUP_CONFIRM USING G_ANS
                                          G_POPUP_TEXT
                                          G_LINE_TEXT .
    If the user opts 'Yes' then delete the selected lines
          IF G_ANS = C_ANS1.
            DELETE I_STORE_INFO WHERE SEL = C_X.
            MESSAGE S161(ZS) WITH TEXT-002.
          ENDIF.
        ELSE.
    Do the same deletion operation even if user does not select the line
    but puts the cursor in any line entry.
          GET CURSOR LINE L_LINE.
          IF SY-SUBRC = 0.
            L_LINE = L_LINE + TBCL_HEAD1-TOP_LINE - 1.
            CLEAR G_POPUP_TEXT.
            G_POPUP_TEXT =  TEXT-065.
            CLEAR G_LINE_TEXT.
            PERFORM GET_POPUP_CONFIRM USING G_ANS
                                            G_POPUP_TEXT
                                           G_LINE_TEXT.
            IF G_ANS = C_ANS1.
              DELETE I_STORE_INFO INDEX L_LINE.
    Upon successful delete operation issue a success message to the user
              MESSAGE S161(ZS) WITH TEXT-002.
            ENDIF.
          ELSE.
            MESSAGE S161(ZS) WITH TEXT-006.
          ENDIF.
        ENDIF.
      ENDIF.
      DESCRIBE TABLE I_STORE_INFO LINES G_ADD_CNT.
    ENDFORM.                    " DELETE_LINE_STR_GRP
    *&      Form  SELECT_ALL_ENTRIES
    When the user selects the 'Select All' button, then select all the
    entries of the store grouping table by setting the SEL field to X for
    each entry
    FORM SELECT_ALL_ENTRIES.
      IF I_STORE_INFO[] IS INITIAL.
    If the store grouping table is blank then issue message
    'No Entry is available for Selection.' .
        MESSAGE S161(ZS) WITH TEXT-001.
      ELSE.
        LOOP AT I_STORE_INFO .
          I_STORE_INFO-SEL = C_X.
          MODIFY I_STORE_INFO.
        ENDLOOP.
        G_OKCODE = OKCODE.
      ENDIF.
    ENDFORM.                    " SELECT_ALL_ENTRIES
    *&      Form  DESELECT_ALL_ENTRIES
          Deselect all the entries in the table
    FORM DESELECT_ALL_ENTRIES.
      IF I_STORE_INFO[] IS INITIAL.
    If the store grouping table is blank then issue message
    'No Entry is available for Selection.' .
        MESSAGE S161(ZS) WITH TEXT-001.
      ELSE.
        LOOP AT I_STORE_INFO .
          I_STORE_INFO-SEL = C_SPACE.
          MODIFY I_STORE_INFO.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " DESELECT_ALL_ENTRIES
    *&      Form  SAVE_PROMO
          Save the promo Event.
    FORM SAVE_PROMO.
      DATA: L_DATUM LIKE SY-DATUM,
            L_SUBRC LIKE SY-SUBRC .
    Populate dept/class/subclass if sku or style is not blank
      PERFORM POPULATE_DEPT_CLASS.
      DATA: G_PROMONO LIKE ZSDRETL_RMPHEAD-PP_ID.
      IF G_PROMO_CHG_FLAG = C_X.
        G_PROMONO = G_PROMO_ID.
      ELSE.
    Get number range for the promo
        CALL FUNCTION 'NUMBER_GET_NEXT'
             EXPORTING
                  NR_RANGE_NR   = C_NR_OBJ1
                  OBJECT        = C_NROBJ
                  QUANTITY      = '1'
                  IGNORE_BUFFER = C_X
             IMPORTING
                  NUMBER        = G_PROMONO.
        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.
      IF NOT G_PROMONO IS INITIAL.
        REFRESH I_RMPHEAD.
        CLEAR   WA_RMPHEAD.
    If Override flag is set for any SKU end that promo first
        READ TABLE I_SKU_INFO WITH KEY OVERRIDE = C_X.
        IF SY-SUBRC = 0.
         perform end_existing_promo .
        ENDIF.
    Populate Header information for Promo event
        REFRESH I_RMPHEAD.
        CLEAR   WA_RMPHEAD.
        IF SY-DYNNR = '9006'.
          WA_RMPHEAD-PP_ID = G_PROMONO.
          WA_RMPHEAD-ID_TYPE = C_P.
          WA_RMPHEAD-PLTYP = ZPRICELIST-ZLIST.
          WA_RMPHEAD-APPROVE = CHK_APR.
          WA_RMPHEAD-ERDAT = SY-DATUM.
          WA_RMPHEAD-ERNAM = SY-UNAME.
          WA_RMPHEAD-ID_DESC = G_PDESC.
          WA_RMPHEAD-START_DATE = ZSDRETL_RMPHEAD-START_DATE.
          WA_RMPHEAD-END_DATE = ZSDRETL_RMPHEAD-END_DATE.
          WA_RMPHEAD-CLEARANCE = C_SPACE.
          WA_RMPHEAD-PROMO_TYPE = G_PTYPE.
          APPEND WA_RMPHEAD TO I_RMPHEAD.
          CLEAR  WA_RMPHEAD.
        ELSE.
          WA_RMPHEAD-PP_ID = G_PROMONO.
          WA_RMPHEAD-ID_TYPE = C_P.
          WA_RMPHEAD-PLTYP = G_PRICELIST.
          WA_RMPHEAD-APPROVE = CHK_APR.
          WA_RMPHEAD-ERDAT = SY-DATUM.
          WA_RMPHEAD-ERNAM = SY-UNAME.
          WA_RMPHEAD-ID_DESC = G_PDESC.
          WA_RMPHEAD-START_DATE = ZSDRETL_RMPHEAD-START_DATE.
          L_SUBRC = 4.
          LOOP AT I_SKU_INFO.
            IF I_SKU_INFO-END_DATE GE ZSDRETL_RMPHEAD-START_DATE .
          if i_sku_info-end_date ge sy-datum.
              L_SUBRC = 0.
              EXIT.
            ENDIF.
          ENDLOOP.
          IF L_SUBRC = 4.
            L_DATUM = ZSDRETL_RMPHEAD-START_DATE - 1.
          l_datum = sy-datum - 1.
            WA_RMPHEAD-END_DATE = L_DATUM.
          ELSE.
            WA_RMPHEAD-END_DATE = ZSDRETL_RMPHEAD-END_DATE.
          ENDIF.
          WA_RMPHEAD-CLEARANCE = G_CHK_CLR.
          WA_RMPHEAD-PROMO_TYPE = G_PROMO_TYPE.
          APPEND WA_RMPHEAD TO I_RMPHEAD.
          CLEAR  WA_RMPHEAD.
        ENDIF.
        IF NOT I_RMPHEAD[] IS INITIAL.
          MODIFY ZSDRETL_RMPHEAD FROM TABLE I_RMPHEAD.
          IF SY-SUBRC = 0.
            CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
                 EXPORTING
                      PERCENTAGE = 0
                      TEXT       = TEXT-067.
            COMMIT WORK.
          ENDIF.
        ENDIF.
    Populate Store information for Promo event
        REFRESH I_RMPSTORE.
        CLEAR   WA_RMPSTORE.
        IF SY-DYNNR = '9006' OR G_PROMO_PLTYP = C_X.
          WA_RMPSTORE-PP_ID = G_PROMONO.
          WA_RMPSTORE-RECNO = 0.
          WA_RMPSTORE-START_DATE = ZSDRETL_RMPHEAD-START_DATE.
          WA_RMPSTORE-END_DATE = ZSDRETL_RMPHEAD-END_DATE.
          WA_RMPSTORE-STORE_LEVEL = C_LEVEL6.
          WA_RMPDETAIL-ID_TYPE = C_P.
          WA_RMPDETAIL-PLTYP = G_PRICELIST.
          APPEND WA_RMPSTORE TO I_RMPSTORE.
          CLEAR WA_RMPSTORE.
        ELSE.
          LOOP AT I_STORE_INFO.
            WA_RMPSTORE-PP_ID = G_PROMONO.
            WA_RMPSTORE-RECNO = SY-TABIX.
            WA_RMPSTORE-START_DATE = ZSDRETL_RMPHEAD-START_DATE.
            WA_RMPSTORE-END_DATE = ZSDRETL_RMPHEAD-END_DATE.
            WA_RMPSTORE-REGION_ID = I_STORE_INFO-REGION_ID.
            WA_RMPSTORE-DIST_ID = I_STORE_INFO-DIST_ID.
            WA_RMPSTORE-AREA_ID = I_STORE_INFO-AREA_ID.
            WA_RMPSTORE-STORE_ID = I_STORE_INFO-STORE_ID.
            WA_RMPSTORE-ATTR_VAL = I_STORE_INFO-ATTR_VAL.
            WA_RMPSTORE-STORE_LEVEL = I_STORE_INFO-LEVEL.
            WA_RMPSTORE-ID_TYPE = C_P.
            WA_RMPSTORE-PLTYP = G_PRICELIST.
            APPEND WA_RMPSTORE TO I_RMPSTORE.
            CLEAR WA_RMPSTORE.
          ENDLOOP.
        ENDIF.
        IF NOT I_RMPSTORE[] IS INITIAL.
          IF NOT I_RMPSTORE_TEMP[] IS INITIAL.
            READ TABLE I_RMPSTORE_TEMP INTO WA_RMPSTORE INDEX 1.
            IF SY-SUBRC = 0.
              PERFORM ENQUEUE USING WA_RMPSTORE-PP_ID.
            ENDIF.
            DELETE ZSDRETL_RMPSTORE FROM TABLE I_RMPSTORE_TEMP.
            IF SY-SUBRC = 0.
              COMMIT WORK.
              PERFORM DEQUE.
              REFRESH I_RMPSTORE_TEMP.
            ENDIF.
          ENDIF.
          MODIFY ZSDRETL_RMPSTORE FROM TABLE I_RMPSTORE.
          IF SY-SUBRC = 0.
            CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
                 EXPORTING
                      PERCENTAGE = 0
                      TEXT       = TEXT-066.
            COMMIT WORK.
          ENDIF.
        ENDIF.
    Populate SKU information for Promo event
        CLEAR: WA_RMPDETAIL , I_RMPDETAIL[].
        IF SY-DYNNR = '9006'.
          WA_RMPDETAIL-PP_ID = G_PROMONO.
          WA_RMPDETAIL-RECNO = 0.
          WA_RMPDETAIL-START_DATE = ZSDRETL_RMPHEAD-START_DATE.
          WA_RMPDETAIL-END_DATE = ZSDRETL_RMPHEAD-END_DATE.
          WA_RMPDETAIL-VALUE = G_VAL_PLTYP.
          WA_RMPDETAIL-ZLEVEL = C_LEVEL1.
          APPEND WA_RMPDETAIL TO I_RMPDETAIL.
          CLEAR  WA_RMPDETAIL.
        ELSE.
          LOOP AT I_SKU_INFO.
            WA_RMPDETAIL-PP_ID = G_PROMONO.
            WA_RMPDETAIL-RECNO = SY-TABIX.
            WA_RMPDETAIL-START_DATE = I_SKU_INFO-START_DATE.
            IF ZSDRETL_RMPHEAD-END_DATE LT ZSDRETL_RMPHEAD-START_DATE.
          if zsdretl_rmphead-end_date lt sy-datum.
              WA_RMPDETAIL-END_DATE = ZSDRETL_RMPHEAD-END_DATE.
            ELSE.
              WA_RMPDETAIL-END_DATE = I_SKU_INFO-END_DATE.
            ENDIF.
            WA_RMPDETAIL-DEPT = I_SKU_INFO-DEPT.
            WA_RMPDETAIL-CLASS = I_SKU_INFO-CLASS.
            WA_RMPDETAIL-SUB_CLASS = I_SKU_INFO-SUB_CLASS.
            WA_RMPDETAIL-STYLE = I_SKU_INFO-STYLE.
            WA_RMPDETAIL-SKU = I_SKU_INFO-SKU.
            WA_RMPDETAIL-VALUE = I_SKU_INFO-VALUE.
            WA_RMPDETAIL-BASIC_PRICE = I_SKU_INFO-KBETR.
            WA_RMPDETAIL-ZLEVEL = I_SKU_INFO-TYPE.
            WA_RMPDETAIL-TOP_UP = I_SKU_INFO-TOP_UP.
            WA_RMPDETAIL-OVERRIDE = I_SKU_INFO-OVERRIDE.
            WA_RMPDETAIL-ZLEVEL = I_SKU_INFO-TYPE.
            WA_RMPDETAIL-REF_PROMO = I_SKU_INFO-REF_PROMO.
            WA_RMPDETAIL-ID_TYPE = C_P.
            WA_RMPDETAIL-PLTYP = G_PRICELIST.
            APPEND WA_RMPDETAIL TO I_RMPDETAIL.
            CLEAR  WA_RMPDETAIL.
          ENDLOOP.
        ENDIF.
        IF NOT I_RMPDETAIL[] IS INITIAL.
          IF NOT I_RMPDETAIL_TEMP[] IS INITIAL.
            READ TABLE I_RMPDETAIL_TEMP INTO WA_RMPDETAIL INDEX 1.
            IF SY-SUBRC = 0.
              PERFORM ENQUEUE USING WA_RMPDETAIL-PP_ID.
            ENDIF.
            DELETE ZSDRETL_RMPDETL FROM TABLE I_RMPDETAIL_TEMP.
            IF SY-SUBRC = 0.
              COMMIT WORK.
              PERFORM DEQUE.
              REFRESH I_RMPDETAIL_TEMP.
            ENDIF.
          ENDIF.
          MODIFY ZSDRETL_RMPDETL FROM TABLE I_RMPDETAIL.
          IF SY-SUBRC = 0.
            CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
                 EXPORTING
                      PERCENTAGE = 0
                      TEXT       = TEXT-068.
            COMMIT WORK.
          ENDIF.
        ENDIF.
        IF SY-SUBRC = 0.
          IF G_PROMO_CHG_FLAG = C_X.
            MESSAGE S161(ZS)
                 WITH TEXT-046 G_PROMONO TEXT-048.
          ELSE.
            MESSAGE S161(ZS)
                   WITH TEXT-046 G_PROMONO TEXT-049.
          ENDIF.
          LEAVE TO SCREEN 9000.
        ENDIF.
      ENDIF.
    ENDFORM.                    " SAVE_PROMO
    *&      Form  EXIT_FROM_HEADER_SCREEN
          Exit from header screen
    FORM EXIT_FROM_HEADER_SCREEN.
    in case of view promo and view pricing , come back to the view/copy
    screen
      IF G_MAIN_OKCODE = 'VRPR' AND (  G_PROMO_VIEW_FLAG = C_X
                                    OR G_PRICING_VIEW_FLAG = C_X ).
        LEAVE TO SCREEN 9007.
      ELSE.
    if store grouping info table is empty then come back to the main menu
        IF I_STORE_INFO[] IS INITIAL.
          LEAVE TO SCREEN 9000.
        ELSE.
    if store grouping info contains a blank record then come to main menu
          READ TABLE I_STORE_INFO INDEX 1.
          IF SY-SUBRC = 0 AND I_STORE_INFO-REGION_ID IS INITIAL
                          AND I_SKU_INFO[] IS INITIAL.
            LEAVE TO SCREEN 9000.
          ENDIF.
    if SKU info table is blank then issue message if the user wants to
    exit from the header screen without entring the promo/pricing detail
          IF I_SKU_INFO[] IS INITIAL.
            CLEAR G_ANS .
            IF G_MAIN_OKCODE = 'CRPR' OR G_MAIN_OKCODE = 'PRCC'.
              G_POPUP_TEXT = TEXT-069.
            ELSE.
              G_POPUP_TEXT = TEXT-070.
            ENDIF.
    Call FM for pop-up message
            CLEAR G_LINE_TEXT.
            PERFORM GET_POPUP_CONFIRM USING G_ANS G_POPUP_TEXT G_LINE_TEXT.
            IF G_ANS = C_ANS1.
              LEAVE TO SCREEN 9000.
            ENDIF.
          ELSE.
    if sku info is avilable & user presses exit then a message is issued
    if the user wants to leave without saving the promo/pricing event
            CLEAR G_ANS .
            IF G_MAIN_OKCODE = 'CRPR' OR G_MAIN_OKCODE = 'PRCC'.
              G_POPUP_TEXT = TEXT-071.
            ELSE.
              G_POPUP_TEXT = TEXT-072.
            ENDIF.
    Call FM for pop-up message
            CLEAR G_LINE_TEXT.
            PERFORM GET_POPUP_CONFIRM USING G_ANS G_POPUP_TEXT G_LINE_TEXT.
    If user presses 'Yes' then go back to the main menu
            IF G_ANS = C_ANS1.
              LEAVE TO SCREEN 9000.
    if user pressed 'No' then prompts the message if the user wants to go
    back without saving if it says 'Yes' , then go to the main menu and if
    it says 'No' then save the event and go back to main menu
            ELSEIF G_ANS = C_ANS2.
              CLEAR G_ANS .
                 message s161(zs) with text-164.
                 exit.
             IF G_MAIN_OKCODE = 'CRPR' OR G_MAIN_OKCODE = 'PRCC'.
               G_POPUP_TEXT = TEXT-073.
             ELSE.
               G_POPUP_TEXT = TEXT-074.
             ENDIF.
    Call FM for pop-up message
             CLEAR G_LINE_TEXT.
           PERFORM GET_POPUP_CONFIRM USING G_ANS G_POPUP_TEXT G_LINE_TEXT.
             IF G_ANS = C_ANS1.
               IF G_MAIN_OKCODE = 'CRPR' OR G_MAIN_OKCODE = 'PRCC'.
    Call save pricing subroutine to save the pricing event
                 MESSAGE S161(ZS) WITH TEXT-164.
                 perform save_pricing.
               ELSE.
    Call save promo subroutine to save the promo event
                 perform save_promo.
                 MESSAGE S161(ZS) WITH TEXT-164.
               ENDIF.
             ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " EXIT_FROM_HEADER_SCREEN
    *&      Form  VIEW_PROMOS
      Call subroutine to view all the pre-existing promos that are
      available for the selected lines
    FORM VIEW_PROMOS.
      CASE SY-DYNNR.
        WHEN '9001'.
          G_DYNNR = SY-DYNNR.
    Display all the promo that are already exist for the selected entries
    in store grouping table
    Begin of DEVK939178
    logic is changed to check if any existing promo available with higher
    store hierarchy
          PERFORM VIEW_PRE_PROMO_STRGRP.
    End of DEVK939178
        WHEN '9002'.
          G_DYNNR = SY-DYNNR.
    Display all the promo that are already exist for the selected entries
    in sku hierarchy table
    Begin of DEVK939196
          PERFORM VIEW_PROMO_FOR_SKUHIER1 .
    End of DEVK939196
      ENDCASE.
    ENDFORM.                    " VIEW_PROMOS
    *&      Form  VIEW_PRICING
          View the existing pricing if available for an entry
    FORM VIEW_PRICING.
      CASE SY-DYNNR.
        WHEN '9001'.
          G_DYNNR = SY-DYNNR.
    Display all the pricings that are already exist for  selected entries
    in store grouping table
          PERFORM VIEW_PRE_PROMO_STRGRP .
        WHEN '9002'.
          G_DYNNR = SY-DYNNR.
    Display all the pricings that are already exist for  selected entries
    in sku hierarchy table
          PERFORM VIEW_PROMO_FOR_SKUHIER1.
      ENDCASE.
    ENDFORM.                    " VIEW_PRICING
    *&      Form  VIEW_PROMO_FOR_STRGRP
          Prepare the ALV scenarios to display the existing promos
    FORM VIEW_PROMO_FOR_STRGRP.
      REFRESH I_FIELDCAT.
      CLEAR   I_FIELDCAT.
    Populate the field catalogue table for Stor grouping fields
      PERFORM POPULATE_CATALOGUE USING:
    Position       Fieldname  Tablename  Title              Display
       '01'          'REGION_ID'    'I_STR_GRP1'    TEXT-075     ' ',
       '02'          'DIST_ID'      'I_STR_GRP1'    TEXT-076     ' ',
       '03'          'AREA_ID'      'I_STR_GRP1'    TEXT-077     ' ',
       '04'          'ATTR_VAL'     'I_STR_GRP1'    TEXT-078     ' ',
       '05'          'STORE_ID'     'I_STR_GRP1'    TEXT-079     ' ',
       '06'          'PP_ID'        'I_STR_GRP1'    TEXT-084     ' ',
       '07'          'START_DATE'   'I_STR_GRP1'    TEXT-082     ' ',
       '08'          'END_DATE'     'I_STR_GRP1'    TEXT-083     ' ',
       '09'          'PROMO_TYPE'   'I_STR_GRP1'    TEXT-080     ' ',
       '10'          'CLEARANCE'    'I_STR_GRP1'    TEXT-081     ' ',
       '11'          'ID_DESC'      'I_STR_GRP1'    TEXT-161     ' '.
      LOOP AT I_FIELDCAT INTO STRUCT_CAT.
        CASE STRUCT_CAT-FIELDNAME.
          WHEN 'PROMO_TYPE'.
            IF G_PROMO_FLAG = C_X.
              STRUCT_CAT-NO_OUT = C_SPACE.
            ELSE.
              STRUCT_CAT-NO_OUT = C_X.
            ENDIF.
          WHEN 'CLEARANCE'.
            IF G_PROMO_FLAG = C_X.
              STRUCT_CAT-NO_OUT = C_SPACE.
            ELSE.
              STRUCT_CAT-NO_OUT = C_X.
            ENDIF.
          WHEN 'START_DATE'.
            IF G_PROMO_FLAG = C_X.
              STRUCT_CAT-REPTEXT_DDIC = TEXT-082.
            ELSE.
              STRUCT_CAT-REPTEXT_DDIC = TEXT-085.
            ENDIF.
          WHEN 'END_DATE'.
            IF G_PROMO_FLAG = C_X.
              STRUCT_CAT-REPTEXT_DDIC = TEXT-083.
            ELSE.
              STRUCT_CAT-REPTEXT_DDIC = TEXT-086.
            ENDIF.
          WHEN 'PP_ID'.
            IF G_PROMO_FLAG = C_X.
              STRUCT_CAT-REPTEXT_DDIC = TEXT-084 .
            ELSE.
              STRUCT_CAT-REPTEXT_DDIC = TEXT-088.
            ENDIF.
        ENDCASE.
        MODIFY I_FIELDCAT FROM STRUCT_CAT INDEX SY-TABIX.
      ENDLOOP.
      CLEAR STRUCT_LAYOUT.
      STRUCT_LAYOUT-COLWIDTH_OPTIMIZE = C_X.
      IF G_PROMO_FLAG = C_X.
        STRUCT_LAYOUT-WINDOW_TITLEBAR   = TEXT-089.
      ELSE.
        STRUCT_LAYOUT-WINDOW_TITLEBAR   = TEXT-090.
      ENDIF.
      STRUCT_LAYOUT-ZEBRA = C_X.
    Populate sort table
      PERFORM POPULATE_SORT_TABLE.
    populate event table
      PERFORM POPULATE_EVENT_TABLE.
    Call function to display the list of existing promos in ALV format
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = G_REPID
                IS_LAYOUT          = STRUCT_LAYOUT
                IT_FIELDCAT        = I_FIELDCAT
                IT_SORT            = I_SORTTAB[]
                IT_EVENTS          = I_EVENT[]
           TABLES
                T_OUTTAB           = I_STR_GRP1
           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.                    " VIEW_PROMO_FOR_STRGRP
    *&      Form  POPULATE_CATALOGUE
          Populating general informations for output format
         -->p_position     Column position
         -->p_fname        Field name
         -->p_tabname      Internal table name
         -->p_title        Title
         -->p_display      Display/No display
    FORM POPULATE_CATALOGUE USING    P_POSITION TYPE SYCUCOL
                                     P_FNAME    TYPE FIELDNAME
                                     P_TABNAME  TYPE TABNAME
                                     P_TITLE    TYP

    Hi sahil,
    probably one or more fields used for comparison in for all entries where clause is not part of the refered table. The error is given for one of your for all entries select - I don't know which one it was. Check this condition: Are all fields like i.e. I_SKU_HIER-PP_ID parts of the used tables?
    Maybe ther is a typo.
    Regards,
    Clemens

  • RECORDING WITH F-32 .......ITS URGENT PLZ HELP ME

    HI GUYS
    HERE IS MY REQUIREMENT
    I WANT TO DO A RECORDING USING F-32 AND I HAVE TO DO THE FOLLOWING WAYS
    1- ENTER ACCOUNT
    2-COMPANY CODE
    3-CLEARING DATE
    4-OPENITEM SELETION
    5-I HAVE TO SELECT THE REFERENCE RADIO BUTTON
    HERE IS MY ERROR , I DONT KNOW WHAT ARE THE VALUE I HAVE TO ENTER IN THE REFERENCE FIELD AND HOW TO PROCEED ,PLZ HELP ME IT IS VERY VERY URGENT FOR ME.
    THANKS A LOT
    MRUTYUN

    This should get you started:
    FORM clearing USING    p_purch_order
                           p_cus
                           p_ven.
      DATA: okcode(3).
      CLEAR bdcdata.
      CLEAR messtab.
      REFRESH bdcdata.
      REFRESH messtab.
      MESSAGE s205 WITH 'Clearing A/R Invoice to Invoice Receipt.'.
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0131',       "Clear Customer: Header Data
       ' ' 'RF05A-AGKON'      bill_to,
       ' ' 'BKPF-BUDAT'       today_ch,
       ' ' 'BKPF-BUKRS'      'UOFT',
       ' ' 'BKPF-WAERS'      'CAD',
       ' ' 'RF05A-XNOPS'     'X',
       ' ' 'RF05A-XPOS1(2)'  'X',
       ' ' 'BDC_OKCODE'      '/16'.        "Process Open Items
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0730',       "Amount popup
       ' ' 'BDC_OKCODE'      '/16'.        "Process Open Items
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0730'.       "Press enter
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0710',"Clear Customer: Enter selection criteri
       ' ' 'RF05A-AGBUK'     'UOFT',
       ' ' 'RF05A-AGKON'      bill_to,
       ' ' 'RF05A-AGKOA'     'D',
       ' ' 'RF05A-XNOPS'     'X',
       ' ' 'RF05A-XMULK'     'X',
       ' ' 'RF05A-XPOS1(1)'  'X',
       ' ' 'BDC_OKCODE'      '/16'.        "Process Open Items
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0609',       "Additional Accounts popup
       ' ' 'RF05A-AGKON(1)'   p_ven,
       ' ' 'RF05A-AGKOA(1)'  'K',
       ' ' 'RF05A-XNOPS(1)'  'X'.
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      'OMX'.        "Select all
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      '/6'.         "Inactive
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      '/6'.         "Find
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '2000',       "Select search criteria popup
       ' ' 'BDC_OKCODE'      '/24'.        "Next page
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '2000',       "Select search criteria popup
       ' ' 'RF05A-XPOS1(10)' 'X'.          "Allocation
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '0731',       "Search for Allocation
       ' ' 'RF05A-SEL01(1)'   p_purch_order.                    "PO
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      'OMX'.        "Select all
      PERFORM dynpro USING:
    'X' 'SAPDF05X'        '1102',         "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'    '/05'.          "Active
      IF p_test = space.
        okcode = '/11'.                    "save
      ELSE.
        okcode = 'BS'.                     "simulate
      ENDIF.
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',
       ' ' 'BDC_OKCODE'       okcode.      " save or check
      IF p_test NE space.                  "exit from screen after check
        PERFORM dynpro USING:
         'X' 'SAPMF05A'        '0700',
         ' ' 'BDC_OKCODE'       '/15'.     "Save or check
        PERFORM dynpro USING:              "popup
         'X' 'SAPLSPO1'        '0200',
         ' ' 'BDC_CURSOR'      'SPOP-OPTION1'.       "choose yes
      ENDIF.
      CALL TRANSACTION 'F-32' USING bdcdata MODE u_mode UPDATE 'S'
                                            MESSAGES INTO messtab.
      PERFORM get_message TABLES messtab USING text 'CL'.
      IF text IS INITIAL.
        PERFORM batch_input USING 'F-32'.
      ENDIF.
    ENDFORM.                               " CLEARING
    Rob

  • How to get rid of OKCODE Box on WebSAPConsole

    The RF devices we are using are SYMBOL MC9090. We are running WebSAPConsole and there are two problems that are killing us right now:
    1- We can't seem to program the ENTER key (to affect navigation) into the RF devices. We want the bar code scan to have a suffix with an ENTER key to navigate to the next field. This doesn't appear to be working.  Anyone have this working that can tell us how they did it?
    2- We want to get rid of the OKCODE box which is now displayed at the bottom of all our screens. I noticed that others have examples of their screens without this box displayed so I assume it can be turned off....
    I realize I may have used the wrong terms and these problems may have already been addressed. Anyone that can point me in the right direction?

    We need to get rid of the OKCODE Box on the bottom of the screens. My programs are standard SAP screens and I have tried modal dialog screens with the STARTING AT and ENDING AT commands. All behave the same way.
    I have no OKCODE on these screens and none is present when we run in the standard GUI. However, the OKCODE is present when we run on the handhelds.
    The handhelds are MC9090 (Symbol) running Windows Mobile, we are running WebSAPConsole and we just want to get rid of the OKCODE Box on the bottom of the screens.
    The SAP standard RF transactions behave the same way as the custom transactions. Can we just get rid of the OKCODE box on the bottom of the screens?
    Thansk again for the help.... this is killing us right now....
    Steve

  • Help on ALV grid needed...

    HI, I am a new comer to SAP and I have some material on ALV grid but not enough to write code to display from an internal table to the grid. I have written the code using 2 methods:
    1. set_table_for_first_display and
    2. reuse_alv_grid_display
    The code with reuse_alv_grid_disply works fine but am not able to add more functionality to the code as I dont have any material explaining the methods to be used with it. The code with set_table_for_first_display has some problem in it. The code for it is:
    tables kna1.
    data: BEGIN OF itkna1 OCCURS 0,
             ktokd like kna1-ktokd,
             kunnr like kna1-kunnr,
             name1 like kna1-name1,
             name2 like kna1-name2,
          end of itkna1.
    *creating an instance of grid
    data it_custom_control_name type scrfname value 'CC_ALV'.
    data it_container type ref to cl_gui_custom_container.
    data it_alvgrid type ref to cl_gui_alv_grid.
    data it_lyo type lvc_s_layo.
    Selection-screen begin of block Enter_data with frame title text-001.
      PARAMETERS pktokd like KNA1-ktokd OBLIGATORY.
      SELECT-OPTIONS skunnr FOR KNA1-kunnr.
    Selection-screen end of block Enter_data.
    SELECT ktokd kunnr name1 name2
      FROM kna1 into CORRESPONDING FIELDS OF TABLE itkna1
           WHERE ktokd = pktokd AND kunnr IN skunnr.
    *loop at itkna1.
    write:/ itkna1-ktokd, itkna1-kunnr, itkna1-name1, itkna1-name2.
    *ENDLOOP.
    *prepare field catalog
    data it_fcat type lvc_t_fcat.
    data tmp_fcat like LINE OF it_fcat.
    clear: it_fcat, tmp_fcat.
    tmp_fcat-fieldname = 'KTOKD'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'KTOKD'.
    tmp_fcat-col_pos = '1'.
    *tmp_fcat-inttype = 'C'.
    *tmp_fcat-coltext = 'Customer Group'.
    *tmp_fcat-seltext = 'Customer Group'.
    *tmp_fcat-outputlen = '4'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'KUNNR'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'KUNNR'.
    tmp_fcat-col_pos = '2'.
    *tmp_fcat-inttype = 'N'.
    *tmp_fcat-coltext = 'Customer Number'.
    *tmp_fcat-seltext = 'Customer Number'.
    *tmp_fcat-outputlen = '10'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'NAME1'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'NAME1'.
    tmp_fcat-col_pos = '3'.
    *tmp_fcat-inttype = 'C'.
    *tmp_fcat-coltext = 'name'.
    *tmp_fcat-seltext = 'name'.
    *tmp_fcat-outputlen = '12'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'NAME2'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'NAME2'.
    tmp_fcat-col_pos = '4'.
    *tmp_fcat-inttype = 'C'.
    *tmp_fcat-coltext = 'name2'.
    *tmp_fcat-seltext = 'name2'.
    *tmp_fcat-outputlen = '12'.
    append tmp_fcat to it_fcat.
    *prepare layout
    it_lyo-grid_title = 'Custormer details'.
    *creating an instance of container class
    create OBJECT it_container
      EXPORTING
        container_name = it_custom_control_name
      EXCEPTIONS
        cntl_error = 1
        create_error = 2
        OTHERS = 3.
    *creating an instance of the grid
    create OBJECT it_alvgrid
      EXPORTING
        i_parent = it_container
      EXCEPTIONS
        error_dp_create = 1
        OTHERS = 2.
    *displaying the grid
    call METHOD it_alvgrid->set_table_for_first_display
       EXPORTING
         is_layout = it_lyo
         i_structure_name = 'KNA1'
       CHANGING
         it_outtab = itkna1[]
         it_fieldcatalog = it_fcat
       EXCEPTIONS
         invalid_parameter_combination = 1
         others = 2.
    It would be really helpful if some one could tell me what is wrong with this code and tell me where to get the material for extending code using type-pools-slis.
    Thanks in advance!!!

    i cant see any call screen in your prog... if you have to display an alv first you have to create a screen and in that screen you have to create a custom control which will contain the grid... pls go thrugh the prog
    here i have changed your code and it is working in my system just try this..
    tables kna1.
    data: BEGIN OF itkna1 OCCURS 0,
    ktokd like kna1-ktokd,
    kunnr like kna1-kunnr,
    name1 like kna1-name1,
    name2 like kna1-name2,
    end of itkna1.
    *creating an instance of grid
    data it_custom_control_name type scrfname value 'CC_ALV'.
    data it_container type ref to cl_gui_custom_container.
    data it_alvgrid type ref to cl_gui_alv_grid.
    data it_lyo type lvc_s_layo.
    DATA : OKCODE LIKE SY-UCOMM.
    Selection-screen begin of block Enter_data with frame title text-001.
    PARAMETERS pktokd like KNA1-ktokd OBLIGATORY.
    SELECT-OPTIONS skunnr FOR KNA1-kunnr.
    Selection-screen end of block Enter_data.
    SELECT ktokd kunnr name1 name2
    FROM kna1 into CORRESPONDING FIELDS OF TABLE itkna1
    WHERE ktokd = pktokd AND kunnr IN skunnr.
    *loop at itkna1.
    * write:/ itkna1-ktokd, itkna1-kunnr, itkna1-name1, itkna1-name2.
    *ENDLOOP.
    *prepare field catalog
    data it_fcat type lvc_t_fcat.
    data tmp_fcat like LINE OF it_fcat.
    clear: it_fcat, tmp_fcat.
    tmp_fcat-fieldname = 'KTOKD'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'KTOKD'.
    tmp_fcat-col_pos = '1'.
    *tmp_fcat-inttype = 'C'.
    *tmp_fcat-coltext = 'Customer Group'.
    *tmp_fcat-seltext = 'Customer Group'.
    *tmp_fcat-outputlen = '4'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'KUNNR'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'KUNNR'.
    tmp_fcat-col_pos = '2'.
    *tmp_fcat-inttype = 'N'.
    *tmp_fcat-coltext = 'Customer Number'.
    *tmp_fcat-seltext = 'Customer Number'.
    *tmp_fcat-outputlen = '10'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'NAME1'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'NAME1'.
    tmp_fcat-col_pos = '3'.
    *tmp_fcat-inttype = 'C'.
    *tmp_fcat-coltext = 'name'.
    *tmp_fcat-seltext = 'name'.
    *tmp_fcat-outputlen = '12'.
    append tmp_fcat to it_fcat.
    tmp_fcat-fieldname = 'NAME2'.
    tmp_fcat-ref_table = 'KNA1'.
    tmp_fcat-ref_field = 'NAME2'.
    tmp_fcat-col_pos = '4'.
    *tmp_fcat-inttype = 'C'.
    *tmp_fcat-coltext = 'name2'.
    *tmp_fcat-seltext = 'name2'.
    *tmp_fcat-outputlen = '12'.
    append tmp_fcat to it_fcat.
    *prepare layout
    it_lyo-grid_title = 'Custormer details'.
    call screen 100.
    *creating an instance of container class
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'ZSPD'.
    *  SET TITLEBAR 'xxx'.
    create OBJECT it_container
    EXPORTING
    container_name = it_custom_control_name
    EXCEPTIONS
    cntl_error = 1
    create_error = 2
    OTHERS = 3.
    *creating an instance of the grid
    create OBJECT it_alvgrid
    EXPORTING
    i_parent = it_container
    EXCEPTIONS
    error_dp_create = 1
    OTHERS = 2.
    *displaying the grid
    call METHOD it_alvgrid->set_table_for_first_display
    EXPORTING
    is_layout = it_lyo
    *i_structure_name = 'KNA1'
    CHANGING
    it_outtab = itkna1[]
    it_fieldcatalog = it_fcat
    EXCEPTIONS
    invalid_parameter_combination = 1
    others = 2.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
    call method cl_gui_cfw=>dispatch.
    CASE OKCODE.
    WHEN 'EXIT' OR 'BACK'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    regards
    shiba dutta

  • E-CATT!!! Can Somebody please help.

    In E-Catt script i want to append output type for billing document. If i already has 2 types i should continue adding from the 3rd record. If i've 4 types already there i should add the new one in 5th record.
    When we r recording for create test case creating the output type as first item and then executing the test case with some other billig document that already has some output types, the script is trying to insert the output type in first record. But it should append it.  We are trying this script for trnx VF02.
    Please help me. Is there any thing in script that we have like in BDC POA for OK code.

    Hi!
    I found the function 'new entries' in message screen (key F8, okcode V70H). Then you can insert a new value in second line - if there is no filled first line, this should not harm.
    And of course you can change scripts manually, too - I didn't get your question about POA, I guess. What's POA?
    Regards,
    Christian

  • Hide bdc okcode popup screen in tthe processing

    HI all,
    I am calling the bdc call transaction from report.At that time bdc okcode come along with popup screen.How i have to hide popup screen.but the bdcokcode fiel;d should be passed to commnad field.Then only the next screen will be coming.
    My requirement is all screen mode,because after running the report ,depends on the selected entry i am going to show the some sap inherent screen to user.its working fine.but i dont need the popup screen,the bdc ok code available in popup screen as well as command field .I need only in command field only.i have seen command field technical properties.But it shows no tables and data elements.
    thanx,
    raja

    Hi Raja,
    This should help you
    CALL TRANSACTION <tcode>
                           USING  <bdc_data_table>
                           MODE   <A/E/N>
                           UPDATE <S/A/L>
                           MESSAGES INTO <message_table>.
       MODE -> mode of transaction
               A - interactive
               E - Screen only on Error
               N - Background
       UPDATE -> udate for transaction
                 S - Synchronous
                 A - Asynchronous
                 L - Local
    Regards,
    Reema.

  • Thread: Predefined Search Help for WERKS doesn't work properly

    Hi
    I read the above thread which partially helped solve my problem.
    I would like to include werks-low and werks-high on the input screen both with search help and also allow user to input multiple selection if needed.
    All help welcome
    Torben

    Hi
    Many thanks for your help. This is my first dialog program so still learning.
    I choose method 1 from you link but still can't get it to work.
    My code in top program.
    SELECTION-SCREEN BEGIN OF SCREEN 0110 AS SUBSCREEN.
         select-options s_werks for t001w-werks.
    SELECTION-SCREEN END OF SCREEN 0110.
    my screen 0100 flow logic.
    process before output.
      module status_0100.
      CALL subscreen sub1 INCLUDING SAPMZINFO2 0110.
    process after input.
      module okcode.
      module user_command_0100 at exit-command.
      field : m_lifnr module m_check_0100.
      CALL subscreen sub1.
      module read_data.
      module user_command_0100.
    All activates ok.
    But when I execute program I don't see the subscreen and get the following error.
    Call Subscreen: SAPMZINFO2 0100 NO DYNPRO NAME
    What am I doing wrong?
    Regards
    Torben

  • Hi guru's i am senivas i am learning plz help me

    hi guru's i am senivas i am learning userexists concept  plz help me
    i am waiting for

    Hi sri vasu  ,
    User exits :
    1. Introduction:
    User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
    The naming standard of function modules for functionmodule exits is: 
    EXIT_<program name><3 digit suffix> 
    The call to a functionmodule exit is implemented as:
    CALL CUSTOMER.-FUNCTION <3 digit suffix>
    Example:
    The program for transaction VA01 Create salesorder is SAPMV45A
    If you search for CALL CUSTOMER-FUNCTION i program
    SAPMV45A you will find ( Among other user exits):
    CALL CUSTOMER-FUNCTION '003'
      exporting
        xvbak   = vbak
        xvbuk   = vbuk
        xkomk   = tkomk
      importing
        lvf_subrc = lvf_subrc
      tables
        xvbfa = xvbfa
        xvbap = xvbap
        xvbup = xvbup.
    The exit calls function module EXIT_SAPMV45A_003
    2. How to find user exits?
    Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT
    If you know the Exit name, go to transaction CMOD.
    Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.
    You will now come to a screen that shows the function module exits for the exit.
    3. Using Project management of SAP Enhancements, we want to create a project to enahance trasnaction VA01 .
    - Go to transaction CMOD
    - Create a project called ZVA01
    - Choose the Enhancement assign radio button and press the Change button
    In the first column enter V45A0002 Predefine sold-to party in sales document. 
    Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed
    Press Save
    Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.
    Now the function module is displayed. Double click on include ZXVVAU04 in the function module
    Insert the following code into the include: E_KUNNR = '2155'.
    Activate the include program. Go back to CMOD and activate the project. 
    Goto transaction VA01 and craete a salesorder. 
    Note that Sold-to-party now automatically is "2155"
    User exit - A user exit is a three character code that instructs the system to access a program during system processing.
    SXX: S is for standard exits that are delivered by SAP.   XX represents the 2-digit exit number.
    UXX: U is for user exits that are defined by the user.  XX represents the 2-digit exit number
    An example of a user exits :-
    MODULE user_exit_0001 INPUT 
        CASE okcode.
            WHEN 'BACK OR EXIT'.
                CASE sy-dynnr.
                        WHEN '100'.
                             SET SCREEN 0.
                             LEAVE SCREEN.
                        WHEN '200'.
    Note that you can write any code that satisfy your needs.                                                     ****
    But in this case, this was wrote as a sample code for reference sake.                                    ****
    And you can test it.                                                                                ****
                             SET SCREEN 100.
                             LEAVE SCREEN.
                 ENDCASE.
          ENDCASE. 
    Finding User Exits
    Procdedure 1:
    Valid up to at least SAP release 4.0B
    One way to find user exits applicable for a given SAP screen. From the SE38 screen, enter the desired screen main program, and click Utilities > Find In Source Code, and "CUSTOMER-FUNCTION" as the text to search for. This will give you a list of the user exits and where they are called from for all screens in the module pool.
    Note: format of ABAP statement is CALL CUSTOMER-FUNCTION '009', for example. This is the statement called by a submodule attached to the main program.
    Actual related function is EXIT_SAPLCOIH_009, for example. This example refers to customer function 9 in main program SAPLCOIH. Not all user exit functions are names as such, but this is the usual format.
    If you are doing data validation and want to set an error message with a field open, you must be sure that the user exit you are using is linked to a calling module in the PAI section of the screen and the field you wish to be open was in the CHAIN statement which caused the PAI module to be invoked.
    If you use a customer function which was invoked by a PBO module to validate data, the "MESSAGE" statement will cause the screen to return with the desired message at the bottom, but with all screen fields closed for input.
    When you make changes to the include module for a given customer function, you must regenerate the related function group before you will see the changes included in the screen behaviour.
    Procdedure 2:
    Need to find user exits module-wise? Suppose we want to see the available sales module user exits. Go to transaction SE81. Click on SD, then click "edit" on the menu bar and choose select subtree. Click on "information system," Open Environment node, customer exits, and enhancements. Press F8 to get all the user exits for that module. In brief: SE81->SD->Select subtree->Information System->Envir->Exit Techniques->Customers exits->enhancements->Execute(F8)
    The following websites give complete details about user-exits :
    USER EXIT  (SAP Enhancement)
    http://www.planetsap.com/userexit_det_1.htm
    List of all USER EXIT's  (4.6c version)
    http://www.planetsap.com/Userexit_List.htm
    User Exits in FI/CO
    http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc
    Excellent web-site for user-exits
    http://www.abaptalk.com/forum_posts.asp?TID=31&SID=3b18fa1dc8b7b9a1dbdedf36fe3bc2az&PID=56#56
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8
    Enhancements,Creating a project,Assigning SAP enhancements to a project,Editing enhancement components,Activating a project
    http://www.planetsap.com/userexit_main_page.htm
    Find user exits with a TCode
    http://www.erpgenie.com/abap/code/abap26.htm
    SAP User Exits Routine
    http://www.sap-basis-abap.com/sapab013.htm
    cheers!
    gyanaraj
    ****Pls reward points if u find this helpful

  • BDC - table control - experts please help

    Hi experts,
    Please help. I am in need of your help.
    I am working with BDC and I have a table control in one of the screen. Table control has a check box in the first column. While recording how I entered the data is : I select the check box in a row, enter two values in next two columns of that row and then hit enter then the other columns in that row turn from grey to white (initially these columns are greyed out).
    NOw in BDC when I run my session in foreground, I am able to check(select) the check box and enter the values in next two columns and then I have a Enter OKCODE. But when I hit enter it is not able to recognize the row and its unable to turn the greyed out columns in that particular row to white.
    Is there a way to specify in my program that I am hitting enter in one particular row.
    Please help. Let me know if something is not clear. Very urgent . Pleasee respond. Thanks

    Hi Rich,
    Thanks for the replies. I will try that. I got one more doubt. While manually creating the recipes using C201, there is a screen Recipe header. When I record this transaction, I see a different screen for the Recipe header. Fro example the screen numbers are like 4210(manual) and 4211(recording).
    But my problem is there are two fields which are missing in the screen which I am getting while recording C201. These two fields are present on the screen for manual creation. I need to enter those two fields while I record. But how can I do this.
    Please help.

  • F4 help for SC screen field

    Hi All,
       We are running on SRM 4.0 (Classic) with Integarted ITS.
       I have a query reagarding the change of ITS screen templates for the Shopping cart screen.
      On my SC screen,there is  a field called "Required on" which does not have any F4 help(Calendar)...I need to add the same for that field....
      Can anyone suggest what do I need to do for this?is this possible??
    regards,
    Disha.

    Yes,
    you have to modify HTML templates.
    in SRM 5.0, when looking at search criteria template SAPLBBP_PDH_SEARCH 1000, we can see some reference to the calendar from bbpglobal service:
    `<!-- -
    -->
    <!-- 1) Including BHTML functions for the calendar                         -->
    <!-- -
    -->`
    `include (~service="bbpglobal", ~name="BBP_EXT_WIN_CALENDAR.html")`
    `<!-- -
    -->
    <!-- 2) Introducing functions and initialization for the calendar          -->
    <!-- -
    -->`
    `BBP_ITS_EXTW_WindowHandling()`
    Then each date field has been changed to call this calendar:
            `if(GS_SEARCH_FIELD-CREATE_DATE_FROM.exists)`
    `<!-- -
    -->
    <!-- 3) Exchange of the <input ...> by the BHTML function for calendar     -->
    <!-- -
    -->`
                      `BBP_ITS_EXTW_INPUT(id="GS_SEARCH_FIELD-CREATE_DATE_FROM", type="text",
                                          title      = "",
                                          formname   = bbpformname,
                                          inputname  = "GS_SEARCH_FIELD-CREATE_DATE_FROM",
                                          inputvalue = GS_SEARCH_FIELD-CREATE_DATE_FROM.value,
                                          mode       = "1")`
    <!--
              <input type="text" id="GS_SEARCH_FIELD-CREATE_DATE_FROM" name="GS_SEARCH_FIELD-CREATE_DATE_FROM"
                     value="`MaskSpecialChar(GS_SEARCH_FIELD-CREATE_DATE_FROM.value)`" maxlength="010" size="10">
    -->
            `end`
    To help you further, here is the code of HTML template BBP_EXT_WIN_CALENDAR from global service:
    `declare
      BBP_ITS_EXTW_INPUT(id="", type="", title="",
                         formname = "",
                         inputname = "", inputvalue = "",
                         size = "10",
                         mode = "1",
                         mandatory = ""),
      BBP_ITS_EXTW_WindowHandling(),
    in "bbp_ext_win_calendar_def.html";`
    `include(~service="bbpglobal", style=style, ~name="bbp_ext_win_calendar_def.html");`
    And the HTML template BBP_EXT_WIN_CALENDAR_DEF:
    `include(~service="bbpglobal", ~name="generalhtmlb.html");`
    `include(~service="bbpglobal", ~name="bbpfunctions.html");`
    `
    <!-- -
    -->
    <!-- function to include a calendar input field.                           -->
    <!-- id        : ID of the <input> field                                   -->
    <!-- type      : Type of the <input> field                                 -->
    <!-- title     : Title of the <input> field (Tooltip-Text)                 -->
    <!-- formname  : Name of form to send back entered data                    -->
    <!-- inputname : Name of input field in form to send back entered data     -->
    <!-- inputvalue: Value of input field in form to send back entered data    -->
    <!-- size      : Number of possible input characters                       -->
    <!-- mode      : Change / Display mode                                     -->
    <!-- mandataory: Input must be done by user                                -->
    <!-- startdate : Javascript funtion to determine the inital value if the   -->
    <!--             input field is empty.                                     -->
    <!-- -
    -->
    `
    `function BBP_ITS_EXTW_INPUT(id="", type="", title="",
                                 formname = "",
                                 inputname = "", inputvalue = "",
                                 size = "10",
                                 mode = "1",
                                 mandatory = "",
                                 startdate = "")`
      `if ((inputvalue == "") && (startdate != ""))`   
      `end`
      `ltext=text`
      `if (ltype=="") ltype="text" end`
      `if (mode == "1")`
        <input id="`id`" type="`ltype`" title="`title`", name="`inputname`"
               value="`inputvalue`" size="10" onBlur="BBP_ITS_EXTW_CloseCalendar()">
        `if(~accessibility != "1")`
          `a_name = "a_" & inputname`    
          <a id="`a_name`" name="`a_name`"
             href="javascript:BBP_ITS_EXTW_OpenCalendarDomRel(window.document.`formname`.elements['`inputname`'], '`a_name`')">
             <img src="`mimeURL(~service="bbpglobal", ~language="", 
                                ~name="images/calendar/ico12_calendar.gif")`" border="0"></a>
        `end`
      `else`
        `inputvalue`
      `end`
    `end`
    `
    <!-- -
    -->
    <!-- including the javascript functions and initialising global variables  -->
    <!-- -
    -->
    `
    `function BBP_ITS_EXTW_WindowHandling()`
      <script type="text/javascript">
    ` <!--
      // Path to Calendar Icons
      -->`
      BBP_ITS_EXTW_IconPath_L1 =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="images/calendar/Left1.gif")`";
      BBP_ITS_EXTW_IconPath_L2 =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="images/calendar/Left2.gif")`";
      BBP_ITS_EXTW_IconPath_R1 =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="images/calendar/Right1.gif")`";
      BBP_ITS_EXTW_IconPath_R2 =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="images/calendar/Right2.gif")`";
    ` <!--
      -->`
      </script type="text/javascript">
      <script type="text/javascript">
    ` <!--
      // Path to Calendar scripts
      -->`
      BBP_ITS_EXTW_ScriptCal   =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="script/extwin/BBP_ITS_EXTW_CALENDAR.js")`";
      BBP_ITS_EXTW_ScriptDate  =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="script/extwin/BBP_ITS_EXTW_DATE.js")`";
      BBP_ITS_EXTW_ScriptW     =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="script/extwin/BBP_ITS_EXTW_W.js")`";
    ` <!--
      -->`
      </script type="text/javascript">
      <script type="text/javascript">
    ` <!--
      // Path to Calendar style
      -->`
      BBP_ITS_EXTW_CalStyle   =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="style/CALENDAR.css")`";
      BBP_ITS_EXTW_EBPStyle   =
          "`mimeURL(~service="bbpglobal", ~language="", ~name="style/EBPAPPLICATION.css")`";
    ` <!--
      -->`
      </script type="text/javascript">
      <script type="text/javascript"
          src="`mimeURL(~service="bbpglobal", ~language="",
                        ~name="script/extwin/BBP_ITS_EXTW_Date.js")`">
      </script type="text/javascript">
      <script type="text/javascript"
          src="`mimeURL(~service="bbpglobal", ~language="",
                        ~name="script/extwin/BBP_ITS_EXTW_Calendar.js")`">
      </script type="text/javascript">
      <script type="text/javascript"
          src="`mimeURL(~service="bbpglobal", ~language="",
                        ~name="script/extwin/BBP_ITS_EXTW_W.js")`">
      </script type="text/javascript">
      <script type="text/javascript">
    ` <!--
      // ITS Date and Time
      -->`
      BBP_ITS_EXTW_UsrDateFormat = `BBP_ITS_CAL_USRDATEFORMAT`;
      BBP_ITS_EXTW_DateFormat    = BBP_ITS_DAT_GetDateFormat("`~date`");
      BBP_ITS_EXTW_DateStart     = "`~date`";
      BBP_ITS_EXTW_TimeSystem    = "`~time`";
    ` <!--
      // Variables to follow on with date and time while template is not rebuildt.
      -->`
      BBP_ITS_EXTW_CLNTStart     = new Date();
      BBP_ITS_EXTW_CLNTNow       = BBP_ITS_EXTW_CLNTStart;
      BBP_ITS_EXTW_TMPLStart     =
          new Date(BBP_ITS_DAT_GetYear(BBP_ITS_EXTW_DateStart,BBP_ITS_EXTW_DateFormat),
                   (BBP_ITS_DAT_GetMonth(BBP_ITS_EXTW_DateStart,BBP_ITS_EXTW_DateFormat)-1),
                   BBP_ITS_DAT_GetDay(BBP_ITS_EXTW_DateStart,BBP_ITS_EXTW_DateFormat));
      BBP_ITS_EXTW_TMPLNow       = BBP_ITS_EXTW_TMPLStart;
    ` <!--
      -->`
      </script type="text/javascript">
      <script type="text/javascript">
    ` <!--
      // Read month names from resource
      -->`
      BBP_ITS_EXTW_Months = new Array                                                    
          ("`#M_JANUARY`","`#M_FEBRUARY`","`#M_MARCH`","`#M_APRIL`","`#M_MAY`","`#M_JUNE`",
           "`#M_JULY`","`#M_AUGUST`","`#M_SEPTEMBER`","`#M_OCTOBER`","`#M_NOVEMBER`","`#M_DECEMBER`");                    
      // Read day names from resource
      BBP_ITS_EXTW_Days = new Array                                                    
          ("`#D_MONDAY_ABREV`","`#D_TUESDAY_ABREV`","`#D_WENDSDAY_ABREV`","`#D_THURSDAY_ABREV`",
           "`#D_FRIDAY_ABREV`","`#D_SATURDAY_ABREV`","`#D_SUNDAY_ABREV`");                    
      BBP_ITS_EXTW_CWHeader  = "`#CWHEADER_ABREV`";
      BBP_ITS_EXTW_BtnTxt    = "`#TODAY`";
      BBP_ITS_EXTW_WTitle    = "`#WTITLE_CAL`";
      `BBP_BHTMLintoJSVar("BBP_ITS_EXTW_BtnSource",doubleQuotKeep(
         BBPButtonCode(okcode="", label=#TODAY, jsFunction="MToday()", tooltip=#TODAYTOOLTIP, target="", srcFrame="")))`;
    ` <!--
      -->`
      </script type="text/javascript">
      <script type="text/javascript">
    ` <!--
      // Opens the window and writes the html coding to it.
      // function executed when the calendar icon is clicked
      -->`
      function BBP_ITS_EXTW_OpenCalendarDomRel(fInput, anchor)
        BBP_ITS_EXTW_OpenCalendarInit(fInput, anchor);
        var options = BBP_ITS_EXTW_OpenCalendarOptions(fInput, anchor);
        `SRM_WinOpen(~wname="Calendar", ~wnamevariable="",
                     ~opt="", ~optvariable="options",
                     ~wref="BBP_ITS_EXTW_CW", ~wfunc="CALwriteLocal");`
    ` <!--
      // Function is executed when the new pop-up window is opened
      // The call is included in teh dummy HTML Mime dom_relax(i).html in the
      // service BBPGLOBAL.
      // The document content of the new opened window will be overwritten here.
      -->`
      function CALwriteLocal(w)
        BBP_ITS_EXTW_CW = w;
        `if(toupper(~language) == "HE")`
        w.document.write(BBP_ITS_CAL_WritePage_HE(BBP_ITS_EXTW_WTitle,
                                                  BBP_ITS_EXTW_ScriptCal,
                                                  BBP_ITS_EXTW_CalStyle,
                                                  BBP_ITS_EXTW_EBPStyle));
        `else`
        w.document.write(BBP_ITS_CAL_WritePage(BBP_ITS_EXTW_WTitle,
                                               BBP_ITS_EXTW_ScriptCal,
                                               BBP_ITS_EXTW_CalStyle,
                                               BBP_ITS_EXTW_EBPStyle));
        `end`
        w.document.close();
    ` <!--
      -->`
      </script type="text/javascript">
    `end`
    As you can see there is a lot of mofifications to do...
    Rgds
    Christophe

  • Okcode pass while calling the ITS .

    Hi Friends,
    I am calling one ITS url from my webdynpro application. I am able to pass the parameter to the ITS screen but i want to pass the okcode also i did it but its not working .
    Basically what i want to skip the first screen by passing the input value and ok code .But i dont know why the okcode is not working . Below is the URL where i have pass the parameter and ok code . I have declared the ok code on the screen.
    Please suggest if i missed some thing .
    Thanks,
    Satya

    Hello Satya,
    Please have a look at [this Wiki|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=22375]. It might help.
    I hope this helps.
    Best regards,
    Cristiano

  • FKK_S_SECURITY_CHANGE Help

    I have run into a BAPI problem just like the last time where I am using the function FKK_S_SECURITY_CHANGE to reverse the current Security Deposit Request.
    The transaction code should be FPSEC2 - Change Security Deposit Request.
    My code is as follows and I doesn't update the deposit records after I run this.  Again, can you please ask India if they have any sample piece of codes where I will be able to reference as it had already taken me a long time studying the code inside the function already.  What I would like to see is some sample codes as to show the input parameters for the BAPI.
    report ztst_test1.
    type-pools: fkkse.
    data: l_auto      type fkkse_security_auto,
          l_obj       type fkkse_security,
          l_security  type fkk_sec-security,
          l_db_update type sy-datar.
    l_security = '099000000717'.
    call function 'FKK_S_SECURITY_PROVIDE'
      exporting
        x_security           = l_security
        x_wmode              = '02'
      importing
        y_obj                = l_obj
        y_auto               = l_auto
    TABLES
      T_FKKOP_REQ          =
      exceptions
        not_found            = 1
        foreign_lock         = 2
        not_authorized       = 3
        general_fault        = 4
        others               = 5.
    if sy-subrc = 0.
      l_auto-use = 'X'.
      l_auto-okcode = 'REV'.
      l_auto-sec_d-rev_reason = 'OTHL'.
      l_auto-sec_d-nc_status = space.
      call function 'FKK_S_SECURITY_CHANGE'
      exporting
        x_security           = l_security
        x_upd_online         = 'X'
        x_no_dialog          = 'X'
        x_auto               = l_auto
      x_obj                = l_obj
      X_NO_OTHER           =
      importing
        y_db_update          = l_db_update
      Y_NEW_SECURITY       =
      Y_EXIT_TYPE          =
      Y_NEW_SEC            =
      Y_CURFIELD           =
      exceptions
        not_found            = 1
        foreign_lock         = 2
        not_authorized       = 3
        general_fault        = 4
        input_error          = 5
        others               = 6.
      if sy-subrc = 0.
        write:/ 'Update Successful'.
      endif.
    else.
      write:/ 'Error occurred, operation terminated'.
    endif.
    Thank you for your kind attention again.  Your help is kindly appreciated.

    Problem Solved

  • BDC OKCODE LIST

    Hai all,
    I need BDC OKCODE Value List.
    For example:
    OKCODE Value for NEW ENTRIES in table fields.
    PERFORM bdc_field       USING 'BDC_OKCODE' '=NPE'.
    Please give me the list of BDC OKCODE Value and function of like '=NPE'.
    Regards
    Naga

    Thanks, Andreas.
    Your reply is really helpful.
    But I still have a question:
    When coding using BDC OKCODE, some of those function codes require a "=" sign prefix, while others requires the '/' sign.
    Let's take a look at PA30, for example:
    PERFORM bdc_field USING 'BDC_OKCODE'  '=INS'. " for Create
    PERFORM bdc_field USING 'BDC_OKCODE'  '/E'.   " for Cancel
    I don't see this info in the Menu Painter (trans. SE41).
    How can I know, without recording using SHDB, what is the required prefix for each function code?
    Thanks,
    Isaac

  • Okcode

    how many okcode u can create in modulepool and how to clear okcode?

    Hi
    In case of dialog programs , each screen has an okcode field associated with it.
    okcode captures the user command on PAI .
    plz take a look at the code below for further clarification :
    Data :  ok_code type sy-ucomm.
    " in the PAI module MODULE_USER_COMMAND for screen XXX
    module module_user_command .
       ok_code = sy-ucomm.
       CASE ok_code.
       WHEN ' ' .
             " write the code for the operation to b performed
       WHEN ' ' .
             " write code 2 for another command
      ENDCASE.
    endmodule.
    use CLEAR ok_code to clear the value  of ok_code.
    One screen in a module pool program can have a maximum of 1 okcode.
    In the same lines , a module pool program can have as many okcode as the number of screens in it.
    i hope it helps u..in case of further queries plz revert.
    Regards
    Pankaj

Maybe you are looking for

  • How to invoke a stored procedure in database adapter

    Hi All, i have created a database adapter which contains a stored procedure, the procedure is merge process,which bring data from another database, i have made sure that checking for new records and updating any changes from the source database every

  • Please list all steps to rename a URL in an email in Mail

    Perhaps I should make this a new question instead of asking it on a reply to another answered question. ============= HOW do you rename a URL in an email? Please list all the steps starting with opening a new email in Mail. I clicked on Add Hyperlink

  • AWE64 WDM drivers for Windows 98

    Hi! I've put together a music computer running Windows 98SE on a PC with the excellent AWE64 Gold sound card (yes, i know there are newer cards). In order to install the ASIO4ALL drivers for reduced latency, the sound card needs WDM drivers. However,

  • Java Applet's Blank

    After the Java 2012-003 update for Lion, Java Applet's in Safari are blank or unresponsive. I'm not prompted for missing plugins or anything, it's simply non-functioning. I've enabled the Applet plug-in and Web Start applications, but it has no effec

  • Creating a Purchase Requisition

    Hi, I need to know the steps for creating the following.            1. Purchase Requisition            2. Puchase Order            3. Internal Order Thanks Will assign points