MODULE POOLL  PROGRAMING WITH TABLE CONTROL

hi all,
in table control update, edit, delete
please give me the solution
in pai
where i can write
module
regards

*&  Include           ZPPCONFI01
*&      Module  USER_COMMAND_9100  INPUT
      text
module USER_COMMAND_9100 input.
CASE OK_CODE.
WHEN 'FCAST'.
*&& CASTING
if sy-uname = 'PTEAM' .
CALL SCREEN 9200.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
*&& INSPECTION
WHEN 'FINSP'.
if sy-uname = 'PTEAM' .
CALL SCREEN 9300.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
WHEN 'FGLAZ'.
if sy-uname = 'PTEAM' .
CALL SCREEN 9400.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
WHEN 'FMOUL'.
if sy-uname = 'PTEAM' .
CALL SCREEN 9500.
else.
message 'No Autorization' type 'I'.
endif.
CLEAR OK_CODE.
when 'BACK'.
CLEAR : I_TAB, I_TAB1.
REFRESH : I_TAB1.
leave program.
ENDCASE.
endmodule.                 " USER_COMMAND_9100  INPUT
*&      Module  USER_COMMAND_9200  INPUT
      text
module USER_COMMAND_9200 input.
CASE OK_CODE1.
  WHEN 'GO'.
*ROUTINE GETDATA
   PERFORM GETDATA.
   CLEAR OK_CODE1.
*&& BACK
when 'CANCEL'.
    leave program.
  WHEN 'BACK'.
   CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,AFKO-GSTRP,flag,count,qtyflag.
   REFRESH : I_TAB1.
   LEAVE TO SCREEN 9100.
*&& SAVE   INSERT DATA TO ZPPT_CONFIRM
  WHEN 'SAVE'.
    data : co type C,
           del type c.
  LOOP AT I_TAB1.
  IF I_TAB1-LMNGA  IS NOT INITIAL OR
     I_TAB1-LMNGA1 IS NOT INITIAL. "OR
    I_TAB1-XMNGA  IS NOT INITIAL.
        if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'P'.
         MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER at Line' sy-tabix.
          continue.
        endif.
        clear : v_charg.
                    SELECT single CHARG FROM MCHB into v_charg
                                WHERE LGORT = '1080'
                                  AND LVORM <> 'X'
                                  AND CHARG = I_TAB1-CHARG.
                if sy-subrc <> 0.
                Message 'Enter correct batch' type 'W'.
                continue.
                endif.
     IF I_TAB1-LMNGA IS NOT INITIAL AND
        I_TAB1-CHARG IS INITIAL.
        MESSAGE 'Enter Batch' TYPE 'S'.
     ELSE.
*&& ACTIVITY 10
   ZPPT_CONFIRM-CDATE  = SY-DATUM.
   ZPPT_CONFIRM-CTIME  = SY-UZEIT.
   ZPPT_CONFIRM-PDATE  = afko-gstrp.
   ZPPT_CONFIRM-WERKS  = T001W-WERKS.
   ZPPT_CONFIRM-DISPO  = '103'.            "MRP CONTROLLER
   ZPPT_CONFIRM-VORNR  = '0010'.
   ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.     "ORDER NO
   ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   ZPPT_CONFIRM-AUFART = 'ZH23'.          "ORDER TYPE
   ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.   "MATERIAL
   ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
   ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
   ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA.    "MOULD FILL
  ZPPT_CONFIRM-GRUND     = I_TAB1-GRUND. "reason for scrap
   ZPPT_CONFIRM-ZSUPNAME  = SNAME.        "supervioser name
   ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG. "batch
   ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
   ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.    "PRODUCT SCHEDULER
   ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
   ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
   ZPPT_CONFIRM-ZUSER     = sy-uname.
   sno = sno + 1.
   ZPPT_CONFIRM-sno     = sno.
   INSERT ZPPT_CONFIRM.
   CLEAR  ZPPT_CONFIRM.
*&& ACTIVITY 20
   if I_TAB1-XMNGA1 <> space.
   ZPPT_CONFIRM-CDATE  = SY-DATUM.
   ZPPT_CONFIRM-CTIME  = SY-UZEIT.
   ZPPT_CONFIRM-PDATE  = afko-gstrp.
   ZPPT_CONFIRM-WERKS  = T001W-WERKS.
   ZPPT_CONFIRM-DISPO  = '103'.
   ZPPT_CONFIRM-VORNR  = '0020'.
   ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
   ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   ZPPT_CONFIRM-AUFART = 'ZH23'.
   ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
   ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
   ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
   ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA1.   "SCARP
     if I_TAB1-XMNGA1 is NOT INITIAL.
   ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
   ZPPT_CONFIRM-GRUND     = '0001'. "reason for scrap
     CO = 'X'.
     endif.
   ZPPT_CONFIRM-ZSUPNAME  = SNAME.
  ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
   ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
   ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
   ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
   ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
   ZPPT_CONFIRM-ZUSER     = sy-uname.
   sno = sno + 1.
   ZPPT_CONFIRM-sno     = sno.
   INSERT ZPPT_CONFIRM.
   CLEAR  ZPPT_CONFIRM.
   endif.
   if I_TAB1-XMNGA2 <> space.
   ZPPT_CONFIRM-CDATE  = SY-DATUM.
   ZPPT_CONFIRM-CTIME  = SY-UZEIT.
   ZPPT_CONFIRM-PDATE  = afko-gstrp.
   ZPPT_CONFIRM-WERKS  = T001W-WERKS.
   ZPPT_CONFIRM-DISPO  = '103'.
   ZPPT_CONFIRM-VORNR  = '0020'.
   ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
   ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   ZPPT_CONFIRM-AUFART = 'ZH23'.
   ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
   ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
   ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
  ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
   ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA2.   "SCARP
     if I_TAB1-XMNGA2 is NOT INITIAL.
     ZPPT_CONFIRM-GRUND     = '0002'. "reason for scrap
     if co <> 'X'.
      ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
      co = 'X'.
     endif.
     endif.
   ZPPT_CONFIRM-ZSUPNAME  = SNAME.
  ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
   ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
   ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
   ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
   ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
   ZPPT_CONFIRM-ZUSER     = sy-uname.
   sno = sno + 1.
   ZPPT_CONFIRM-sno     = sno.
   INSERT ZPPT_CONFIRM.
   CLEAR  ZPPT_CONFIRM.
   endif.
   if I_TAB1-XMNGA3 <> space.
   ZPPT_CONFIRM-CDATE  = SY-DATUM.
   ZPPT_CONFIRM-CTIME  = SY-UZEIT.
   ZPPT_CONFIRM-PDATE  = afko-gstrp.
   ZPPT_CONFIRM-WERKS  = T001W-WERKS.
   ZPPT_CONFIRM-DISPO  = '103'.
   ZPPT_CONFIRM-VORNR  = '0020'.
   ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
   ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   ZPPT_CONFIRM-AUFART = 'ZH23'.
   ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
   ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
   ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
  ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
   ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA3.   "SCARP
     if I_TAB1-XMNGA3 is NOT INITIAL.
   ZPPT_CONFIRM-GRUND     = '0003'. "reason for scrap
     if co <> 'X'.
      ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
      co = 'X'.
     endif.
     endif.
   ZPPT_CONFIRM-ZSUPNAME  = SNAME.
  ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
   ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
   ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
   ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
   ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
   ZPPT_CONFIRM-ZUSER     = sy-uname.
   sno = sno + 1.
   ZPPT_CONFIRM-sno     = sno.
   INSERT ZPPT_CONFIRM.
   CLEAR  ZPPT_CONFIRM.
   endif.
   if I_TAB1-XMNGA4 <> space.
   ZPPT_CONFIRM-CDATE  = SY-DATUM.
   ZPPT_CONFIRM-CTIME  = SY-UZEIT.
   ZPPT_CONFIRM-PDATE  = afko-gstrp.
   ZPPT_CONFIRM-WERKS  = T001W-WERKS.
   ZPPT_CONFIRM-DISPO  = '103'.
   ZPPT_CONFIRM-VORNR  = '0020'.
   ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.
   ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   ZPPT_CONFIRM-AUFART = 'ZH23'.
   ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.
   ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
   ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
  ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
   ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA4.   "SCARP
     if I_TAB1-XMNGA4 is NOT INITIAL.
   ZPPT_CONFIRM-GRUND     = '0004'. "reason for scrap
     if co <> 'X'.
      ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA1.  "CARRYOUT
      co = 'X'.
     endif.
     endif.
   ZPPT_CONFIRM-ZSUPNAME  = SNAME.
  ZPPT_CONFIRM-CHARG     = I_TAB1-CHARG.
   ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
   ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.
   ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
   ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
   ZPPT_CONFIRM-ZUSER     = sy-uname.
   sno = sno + 1.
   ZPPT_CONFIRM-sno     = sno.
   INSERT ZPPT_CONFIRM.
   CLEAR  ZPPT_CONFIRM.
   endif.
   IF SY-SUBRC = 0.
      DELETE TABLE I_TAB1 FROM I_TAB1.
   ENDIF.
   CLEAR  ZPPT_CONFIRM.
  ENDIF.
  ENDIF.
  ENDLOOP.
  CLEAR OK_CODE1.
ENDCASE.
endmodule.                 " USER_COMMAND_9200  INPUT
*&      Form  GETDATA
      text
-->  p1        text
<--  p2        text
form GETDATA .
refresh i_tab1.
      V_DATE = AFKO-GSTRP.
  SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP  INTO (V_PRDSCHED, V_ZHODNO)
                      WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
    if sy-subrc = 0.
        CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
          EXPORTING
            iv_date                   = V_DATE
         IMPORTING
           EV_MONTH_BEGIN_DATE       = sdate
           EV_MONTH_END_DATE         = edate.
        SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
                                                     AND ENDDA  = '99991231'.
      IF AFKO-PLNBEZ IS NOT INITIAL.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     COBJNR = DOBJNR
               WHERE A~FEVOR = V_PRDSCHED
                 AND A~PLNBEZ = AFKO-PLNBEZ
                 AND A~DISPO = '103'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH23'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'.
        IF SY-SUBRC = 0.
          ccontrol-lines = sy-dbcnt.
          LOOP AT I_TAB1.
            SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                               WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                 AND SPRAS = 'E'.
             IF SY-SUBRC = 0.
                MODIFY I_TAB1 FROM I_TAB1.
                CLEAR I_TAB1.
             ENDIF.
          ENDLOOP.
        ENDIF.
      ELSE.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     COBJNR = DOBJNR
               WHERE A~FEVOR = V_PRDSCHED
                 AND A~DISPO = '103'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH23'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'.
        IF SY-SUBRC = 0.
          ccontrol-lines = sy-dbcnt.
          LOOP AT I_TAB1.
            SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                               WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                 AND SPRAS = 'E'.
             IF SY-SUBRC = 0.
                MODIFY I_TAB1 FROM I_TAB1.
                CLEAR I_TAB1.
             ENDIF.
          ENDLOOP.
        ENDIF.
        ENDIF.
        endif.
sort i_tab1 by plnbez.
endform.                    " GETDATA
*&      Module  F4HELPONCHARG  INPUT
      text
module F4HELPONCHARG input.
CLEAR : V_MATNR, V_STEPL, V_STLNR, V_IDNRK.
CLEAR : C_TOPLINE.
C_TOPLINE = CCONTROL-TOP_LINE - 1.
CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
   POVSTEPL              = v_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.
v_stepl = v_stepl +  C_TOPLINE.
READ TABLE I_TAB1 INDEX v_stepl.
IF SY-SUBRC = 0.
SELECT SINGLE STLNR FROM AFKO INTO V_STLNR
                   WHERE AUFNR = I_TAB1-AUFNR.
       IF SY-SUBRC = 0.
          V_MATNR = I_TAB1-PLNBEZ+0(7).
          CONCATENATE V_MATNR '%' INTO V_MATNR.
          SELECT SINGLE IDNRK FROM STPO INTO V_IDNRK
                             WHERE STLNR = V_STLNR
                               AND IDNRK LIKE V_MATNR.
                 IF SY-SUBRC = 0.
                    SELECT CHARG FROM MCHB INTO TABLE I_BATCH
                                WHERE MATNR LIKE V_IDNRK
                                  AND LGORT = '1080'
                                  AND WERKS = T001W-WERKS
                                  AND LVORM <> 'X'.
                 ENDIF.
       ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
  DDIC_STRUCTURE         = ' '
    retfield               = 'I_TAB-CHARG'
  PVALKEY                = ' '
   DYNPPROG               = SY-REPID
   DYNPNR                 = SY-DYNNR
   DYNPROFIELD            = 'CHARG'
  STEPL                  = 0
   WINDOW_TITLE           = 'BATCH'
  VALUE                  = ' '
   VALUE_ORG              = 'S'
  MULTIPLE_CHOICE        = ' '
  DISPLAY                = ' '
  CALLBACK_PROGRAM       = ' '
  CALLBACK_FORM          = ' '
  MARK_TAB               =
IMPORTING
  USER_RESET             =
  tables
    value_tab              = I_BATCH
  FIELD_TAB              =
  RETURN_TAB             =
  DYNPFLD_MAPPING        =
EXCEPTIONS
  PARAMETER_ERROR        = 1
  NO_VALUES_FOUND        = 2
  OTHERS                 = 3
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.
endmodule.                 " F4HELPONCHARG  INPUT
*&      Module  F4HELPONGRUND  INPUT
      text
module F4HELPONGRUND input.
SELECT GRUND GRDTX FROM TRUGT
                   INTO CORRESPONDING FIELDS OF TABLE I_TRUG
                  WHERE WERKS = T001W-WERKS
                    AND SPRAS = 'E'.
IF SY-SUBRC = 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
  DDIC_STRUCTURE         = ' '
    retfield               = 'I_TAB-GRUND'
  PVALKEY                = ' '
   DYNPPROG               = SY-REPID
   DYNPNR                 = SY-DYNNR
   DYNPROFIELD            = 'GRUND'
  STEPL                  = 1
   WINDOW_TITLE           = 'Variance'
  VALUE                  = ' '
    VALUE_ORG              = 'S'
  MULTIPLE_CHOICE        = ' '
  DISPLAY                = ' '
  CALLBACK_PROGRAM       = ' '
  CALLBACK_FORM          = ' '
  MARK_TAB               =
IMPORTING
  USER_RESET             =
  tables
    value_tab              = I_TRUG
  FIELD_TAB              =
  RETURN_TAB             =
  DYNPFLD_MAPPING        =
EXCEPTIONS
  PARAMETER_ERROR        = 1
  NO_VALUES_FOUND        = 2
  OTHERS                 = 3
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.
endmodule.                 " F4HELPONGRUND  INPUT
*&      Module  MOVE_DATA_TO_INTERNALTAB  INPUT
      text
module MOVE_DATA_TO_INTERNALTAB input.
CLEAR I_TAB1.
CLEAR ZWERKS_HR.
IF T001W-WERKS = '1102'.
ZWERKS_HR = '1200'.
ENDIF.
       if I_TAB-EMPNO <> space and I_TAB-EMPNO+0(1) <> 'P'.
         MESSAGE I991(ZMESSAGE) with 'ENTER POTTER NUMBER'.
***BREAK-POINT.
         FLAG = 'X'.
         COUNT = ( CCONTROL-CURRENT_LINE - CCONTROL-Top_line ) + 1.
         continue.
       endif.
IF I_TAB-EMPNO IS NOT INITIAL.
  SELECT SINGLE ENAME FROM PA0001 INTO I_TAB-ENAME
                     WHERE PERNR = I_TAB-EMPNO.
     SELECT SINGLE A~ENAME
                   A~PERNR
           A~WERKS
           B~USRID
             INTO CORRESPONDING FIELDS OF TABLE I_FINAL
              INTO (I_TAB-ENAME,I_TAB-pernr)
              FROM PA0001 AS A
              JOIN PA0105 AS B ON APERNR = BPERNR
             WHERE B~USRID <> SPACE
               AND B~USRID = I_TAB-EMPNO
               AND A~endda = '99991231'
               AND A~WERKS = ZWERKS_HR
               AND ( B~SUBTY = 'POTT' OR
                   B~SUBTY = 'INSP' OR
                   B~SUBTY = 'GLAZ' OR
                   B~SUBTY = 'STOP' OR
                   B~SUBTY = 'SORT' ).
                   IF SY-SUBRC <> 0.
                   clear : I_TAB-ENAME,I_TAB-pernr.
                   ENDIF.
ENDIF.
MOVE-CORRESPONDING I_TAB TO I_TAB1.
MODIFY I_TAB1 FROM I_TAB1 INDEX CCONTROL-CURRENT_LINE.
endmodule.                 " MOVE_DATA_TO_INTERNALTAB  INPUT
*&      Module  USER_COMMAND_9300  INPUT
      text
module USER_COMMAND_9300 input.
CASE OK_CODE2.
*&& GET DATA FOR INSPECTION
WHEN 'GO'.
PERFORM GETINSDATA.
CLEAR OK_CODE2.
*&& BACK
  WHEN 'BACK'.
   CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,
           AFKO-GSTRP,PA0105-USRID,FLAG,COUNT,COUNT1.
   REFRESH : I_TAB1.
   LEAVE TO SCREEN 9100.
*&& SAVE   INSERT DATA TO ZPPT_CONFIRM
  WHEN 'SAVE'.
  LOOP AT I_TAB1.
  IF I_TAB1-LMNGA  IS NOT INITIAL OR
     I_TAB1-XMNGA  IS NOT INITIAL.
       if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'I'.
         MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER at Line' sy-tabix.
         continue.
       endif.
*&& ACTIVITY 10
   ZPPT_CONFIRM-CDATE  = SY-DATUM.
   ZPPT_CONFIRM-CTIME  = SY-UZEIT.
   ZPPT_CONFIRM-PDATE  = afko-gstrp.
   ZPPT_CONFIRM-WERKS  = T001W-WERKS.
   ZPPT_CONFIRM-DISPO  = '110'.            "MRP CONTROLLER
   ZPPT_CONFIRM-VORNR  = '0010'.
   ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.     "ORDER NO
   ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   ZPPT_CONFIRM-AUFART = 'ZH24'.          "ORDER TYPE
   ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.   "MATERIAL
   ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
   ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
   ZPPT_CONFIRM-rcpts  = I_TAB1-rcpts.
   ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA.    "MOULD FILL
   ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA.    "SCRAP
     if I_TAB1-XMNGA is NOT INITIAL.
   ZPPT_CONFIRM-GRUND     = I_TAB1-GRUND. "reason for scrap
     endif.
   ZPPT_CONFIRM-ZSUPNAME  = SNAME.        "supervioser name
   ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
   ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.    "PRODUCT SCHEDULER
   ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
   ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
   ZPPT_CONFIRM-ZUSER     = sy-uname.
   INSERT ZPPT_CONFIRM.
   IF SY-SUBRC = 0.
      DELETE TABLE I_TAB1 FROM I_TAB1.
   ENDIF.
   CLEAR  ZPPT_CONFIRM.
  ENDIF.
  ENDLOOP.
CLEAR : OK_CODE2.
ENDCASE.
endmodule.                 " USER_COMMAND_9300  INPUT
*&      Form  GETINSDATA
      text
-->  p1        text
<--  p2        text
form GETINSDATA .
refresh i_tab1.
      V_DATE = AFKO-GSTRP.
SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP  INTO (V_PRDSCHED, V_ZHODNO)
                     WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   if sy-subrc = 0.
        CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
          EXPORTING
            iv_date                   = V_DATE
         IMPORTING
           EV_MONTH_BEGIN_DATE       = sdate
           EV_MONTH_END_DATE         = edate.
       SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
                                                    AND ENDDA  = '99991231'.
       IF AFKO-PLNBEZ IS NOT INITIAL.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     COBJNR = DOBJNR
               WHERE
                     A~PLNBEZ = AFKO-PLNBEZ
                 AND A~DISPO = '110'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH24'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'.
        IF SY-SUBRC = 0.
          icontrol-lines = sy-dbcnt.
          LOOP AT I_TAB1.
            SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                               WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                 AND SPRAS = 'E'.
             IF SY-SUBRC = 0.
                MODIFY I_TAB1 FROM I_TAB1.
                CLEAR I_TAB1.
             ENDIF.
          ENDLOOP.
        ENDIF.
      ELSE.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     COBJNR = DOBJNR
               WHERE
              A~FEVOR = V_PRDSCHED
                     A~DISPO = '110'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH24'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'.
        IF SY-SUBRC = 0.
          icontrol-lines = sy-dbcnt.
          LOOP AT I_TAB1.
            SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                               WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                 AND SPRAS = 'E'.
             IF SY-SUBRC = 0.
                MODIFY I_TAB1 FROM I_TAB1.
                CLEAR I_TAB1.
             ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
       endif.
sort i_tab1 by plnbez.
endform.                    " GETINSDATA
*&      Module  USER_COMMAND_9400  INPUT
      text
module USER_COMMAND_9400 input.
CASE OK_CODE3.
*&& GET DATA FOR INSPECTION
WHEN 'GO'.
PERFORM GETGLADATA.
CLEAR OK_CODE3.
*&& BACK
  WHEN 'BACK'.
   CLEAR : I_TAB, I_TAB1,AFKO-PLNBEZ,ZMATKL,T001W-WERKS,
           AFKO-GSTRP,PA0105-USRID,flag,count.
   REFRESH : I_TAB1.
   LEAVE TO SCREEN 9100.
*&& SAVE   INSERT DATA TO ZPPT_CONFIRM
  WHEN 'SAVE'.
  LOOP AT I_TAB1.
  IF I_TAB1-LMNGA  IS NOT INITIAL OR
     I_TAB1-XMNGA  IS NOT INITIAL.
       if I_TAB1-EMPNO <> space and I_TAB1-EMPNO+0(1) <> 'G'.
         MESSAGE I991(ZMESSAGE) with 'ENTER GLAZER NUMBER at Line' sy-tabix.
         continue.
       endif.
*&& ACTIVITY 10
   ZPPT_CONFIRM-CDATE  = SY-DATUM.
   ZPPT_CONFIRM-CTIME  = SY-UZEIT.
   ZPPT_CONFIRM-PDATE  = afko-gstrp.
   ZPPT_CONFIRM-WERKS  = T001W-WERKS.
   ZPPT_CONFIRM-DISPO  = '104'.            "MRP CONTROLLER
   ZPPT_CONFIRM-VORNR  = '0010'.
   ZPPT_CONFIRM-AUFNR  = I_TAB1-AUFNR.     "ORDER NO
   ZPPT_CONFIRM-ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
   ZPPT_CONFIRM-AUFART = 'ZH24'.          "ORDER TYPE
   ZPPT_CONFIRM-MATNR  = I_TAB1-PLNBEZ.   "MATERIAL
   ZPPT_CONFIRM-MAKTX  = I_TAB1-WGBEZ.
   ZPPT_CONFIRM-GAMNG  = I_TAB1-GAMNG.
   ZPPT_CONFIRM-LMNGA  = I_TAB1-LMNGA.    "MOULD FILL
   ZPPT_CONFIRM-XMNGA  = I_TAB1-XMNGA.    "SCRAP
     if I_TAB1-XMNGA is NOT INITIAL.
   ZPPT_CONFIRM-GRUND     = I_TAB1-GRUND. "reason for scrap
     endif.
   ZPPT_CONFIRM-ZSUPNAME  = SNAME.        "supervioser name
   ZPPT_CONFIRM-ZHODNO    = V_ZHODNO.
   ZPPT_CONFIRM-FEVOR     = V_PRDSCHED.    "PRODUCT SCHEDULER
   ZPPT_CONFIRM-PERNR     = I_TAB1-pernr.
   ZPPT_CONFIRM-ENAME     = I_TAB1-ENAME.
   ZPPT_CONFIRM-ZUSER     = sy-uname.
   INSERT ZPPT_CONFIRM.
   IF SY-SUBRC = 0.
      DELETE TABLE I_TAB1 FROM I_TAB1.
   ENDIF.
   CLEAR  ZPPT_CONFIRM.
  ENDIF.
  ENDLOOP.
  CLEAR : OK_CODE3.
ENDCASE.
endmodule.                 " USER_COMMAND_9400  INPUT
*&      Form  GETGLADATA
      text
-->  p1        text
<--  p2        text
form GETGLADATA .
refresh i_tab1.
CLEAR : V_MATNR1.
CONCATENATE '%' V_COLOR '%' INTO V_MATNR1.
      V_DATE = AFKO-GSTRP.
SELECT SINGLE FEVOR ZHODNO FROM ZPP_SUP_MRP  INTO (V_PRDSCHED, V_ZHODNO)
                     WHERE ZSUPNO = ZPP_SUP_MRP-ZSUPNO.
    if sy-subrc = 0.
        CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
          EXPORTING
            iv_date                   = V_DATE
         IMPORTING
           EV_MONTH_BEGIN_DATE       = sdate
           EV_MONTH_END_DATE         = edate.
       SELECT SINGLE ENAME FROM PA0001 INTO SNAME WHERE PERNR = ZPP_SUP_MRP-ZSUPNO
                                                    AND ENDDA  = '99991231'.
        if ZMATKL <> SPACE and AFKO-PLNBEZ <> SPACE.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AMANDT = BMANDT
                AND  AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AMANDT = CMANDT
                AND  AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     CMANDT = DMANDT
                AND  COBJNR = DOBJNR
               JOIN  MARA AS E ON
                     AMANDT = EMANDT
                 AND APLNBEZ = EMATNR
               WHERE
                      A~PLNBEZ = AFKO-PLNBEZ
                    A~PLNBEZ LIKE V_MATNR1
                 AND A~DISPO = '104'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH24'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'
                 AND E~MATKL = ZMATKL.
          elseIF ZMATKL <> SPACE and AFKO-PLNBEZ = SPACE.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AMANDT = BMANDT
                AND  AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AMANDT = CMANDT
                AND  AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     CMANDT = DMANDT
                AND  COBJNR = DOBJNR
               JOIN  MARA AS E ON
                     AMANDT = EMANDT
                 AND APLNBEZ = EMATNR
               WHERE
              A~FEVOR = V_PRDSCHED
                     A~PLNBEZ LIKE V_MATNR1
                 AND A~DISPO = '104'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH24'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'
                 AND E~MATKL = ZMATKL.
          elseIF ZMATKL = SPACE and AFKO-PLNBEZ <> SPACE.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AMANDT = BMANDT
                AND  AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AMANDT = CMANDT
                AND  AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     CMANDT = DMANDT
                AND  COBJNR = DOBJNR
              JOIN  MARA AS E ON
                    AMANDT = EMANDT
                AND APLNBEZ = EMATNR
               WHERE
                      A~PLNBEZ = AFKO-PLNBEZ
                    A~PLNBEZ LIKE V_MATNR1
                 AND A~DISPO = '104'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH24'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'.
                AND E~MATKL = ZMATKL.
          elseIF ZMATKL = SPACE and AFKO-PLNBEZ = SPACE.
        select A~AUFNR
               A~PLNBEZ
               A~GAMNG
               INTO corresponding fields of TABLE I_TAB1
               FROM  AFKO AS A
               JOIN  AFPO AS B ON
                     AMANDT = BMANDT
                AND  AAUFNR = BAUFNR
               JOIN  AUFK AS C ON
                     AMANDT = CMANDT
                AND  AAUFNR = CAUFNR
               JOIN  JEST AS D ON
                     CMANDT = DMANDT
                AND  COBJNR = DOBJNR
              JOIN  MARA AS E ON
                    AMANDT = EMANDT
                AND APLNBEZ = EMATNR
               WHERE
                     A~PLNBEZ = AFKO-PLNBEZ
                     A~PLNBEZ LIKE V_MATNR1
                 AND A~DISPO = '104'
                 AND A~GLTRP between sdate and edate
                 AND B~DAUAT = 'ZH24'
                 AND B~PWERK = T001W-WERKS
                 AND D~STAT  = 'I0002'
                 AND D~INACT <> 'X'.
                AND E~MATKL = ZMATKL.
          endif.
        IF SY-SUBRC = 0.
          gcontrol-lines = sy-dbcnt.
          LOOP AT I_TAB1.
            SELECT SINGLE WGBEZ FROM T023T INTO I_TAB1-WGBEZ
                               WHERE MATKL = I_TAB1-PLNBEZ+0(7)
                                 AND SPRAS = 'E'.
             IF SY-SUBRC = 0.
                MODIFY I_TAB1 FROM I_TAB1.
                CLEAR I_TAB1.
             ENDIF.
          ENDLOOP.
        ENDIF.
        endif.
sort i_tab1 by plnbez.
endform.                    " GETGLADATA
*&      Module  MOVE_DATA_TO_INTERNALTAB_INS  INPUT
      text
module MOVE_DATA_TO_INTERNALTAB_INS input.
CLEAR I_TAB1.
CLEAR ZWERKS_HR.
IF T001W-WERKS = '1102'.
ZWERKS_HR = '1200'.
ENDIF.
        if I_TAB-EMPNO <> space and I_TAB-EMPNO+0(1) <> 'I'.
          MESSAGE I991(ZMESSAGE) with 'ENTER INSPECTOR NUMBER'.
*BREAK-POINT.
          FLAG = 'X'.
          COUNT = ICONTROL-CURRENT_LINE.
         continue.
        endif.
IF I_TAB-EMPNO IS NOT INITIAL.
  SELECT SINGLE ENAME FROM PA0001 INTO I_TAB-ENAME
                     WHERE PERNR = I_TAB-EMPNO.
     SELECT SINGLE A~ENAME
                   A~PERNR
           A~WERKS
           B~USRID
             INTO CORRESPONDING FIELDS OF TABLE I_FINAL
              INTO (I_TAB-ENAME,I_TAB-pernr)
              FROM PA0001 AS A
              JOIN PA0105 AS B ON APERNR = BPERNR
             WHERE B~USRID <> SPACE
               AND B~USRID = I_TAB-EMPNO
               AND A~endda = '99991231'
               AND A~WERKS = ZWERKS_HR
               AND ( B~SUBTY = 'POTT' OR
                   B~SUBTY = 'INSP' OR
                   B~SUBTY = 'GLAZ' OR
                   B~SUBTY = 'STOP' OR
                   B~SUBTY = 'SORT' ).
                   IF SY-SUBRC <> 0.
                   clear : I_TAB-ENAME,I_TAB-pernr.
                   ENDIF.
ENDIF.
MOVE-CORRESPONDING I_TAB TO I_TAB1.
MODIFY I_TAB1 FROM I_TAB1 INDEX ICONTROL-CURRENT_LINE.
endmodule.                 " MOVE_DATA_TO_INTERNALTAB_INS  INPUT
*&      Module  MOVE_DATA_TO_INTERNALTAB_GLA  INPUT
      text
module MOVE_DATA_TO_INTERNALTAB_GLA input.
CLEAR I_TAB1.
CLEAR ZWERKS_HR.

Similar Messages

  • Sort up and sort Down push buttons in module pool with table control wizard

    hi,
    i have created 2 buttons for Sort up and sort Down push buttons in module pool with table control wizard
    please any one can help me.
    regards

    Hi
    Following code is to enable and disable the tbl control using two buttons. Just alter the code and for each button write the sort code.
    REPORT  YJAN27_SCREEN                                               .
    TABLES: SFLIGHT, YFLIGHT_28.
    TYPES: BEGIN OF struct1,
          carrid like sflight-carrid,
          connid like sflight-connid,
          fldate like sflight-fldate,
           END OF struct1.
    CONTROLS TBL1 TYPE TABLEVIEW USING SCREEN 2700.
    DATA: OK_CODE LIKE SY-UCOMM,
          CARRID LIKE SFLIGHT-CARRID,                                    "cols in tbl ctrl
          CONNID LIKE SFLIGHT-CONNID,
          FLDATE LIKE SFLIGHT-FLDATE,
          itab TYPE TABLE OF STRUCT1 WITH HEADER LINE,
          cols like line of TBL1-COLS,
          FLAG TYPE I.
    FLAG = 1.
    CALL SCREEN 2700.
    *&      Module  STATUS_2700  OUTPUT
    *       text
    MODULE STATUS_2700 OUTPUT.
      SET PF-STATUS 'BACK'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_2700  OUTPUT
    *&      Module  USER_COMMAND_2700  INPUT
    *       text
    MODULE USER_COMMAND_2700 INPUT.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
      WHEN 'BACK'.
        LEAVE PROGRAM.
      WHEN 'DIS'.                                                         "write code for sort up
        loop AT TBL1-COLS INTO COLS.
           COLS-SCREEN-INPUT = 0.
            MODIFY TBL1-COLS FROM COLS.
        ENDLOOP.
        FLAG = 2.
      WHEN 'ENA'.                                                       "write code for sort down
        loop AT TBL1-COLS INTO COLS.
            COLS-SCREEN-INPUT = 1.
            MODIFY TBL1-COLS FROM COLS.
        ENDLOOP.
        FLAG = 1.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_2700  INPUT
    *&      Module  GET_DATA  OUTPUT
    *       text
    MODULE GET_DATA OUTPUT.
      select carrid connid fldate from SFLIGHT into table itab.
    ENDMODULE.                 " GET_DATA  OUTPUT
    *&      Module  POPULATE_TBL  OUTPUT
    *       text
    MODULE POPULATE_TBL OUTPUT.
        MOVE-CORRESPONDING ITAB TO SFLIGHT.
    ENDMODULE.                 " POPULATE_TBL  OUTPUT
    *&      Module  CHANGE_SCREEN  OUTPUT
    *       text
    MODULE CHANGE_SCREEN OUTPUT.    " use this module if you want to hide the other button
    CASE FLAG.
      WHEN 1.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_ENA'.
            SCREEN-INVISIBLE = 1.
             MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_DIS'.
            SCREEN-INVISIBLE = 0.
             MODIFY SCREEN.
          ENDIF.
       ENDLOOP.
      WHEN 2.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_DIS'.
            SCREEN-INVISIBLE = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'B_ENA'.
            SCREEN-INVISIBLE = 0.
             MODIFY SCREEN.
          ENDIF.
       ENDLOOP.
    ENDCASE.
    ENDMODULE.                 " CHANGE_SCREEN  OUTPUT
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_2700.
    MODULE CHANGE_SCREEN.     " use this if you want to display one button at a time
    MODULE GET_DATA.
    loop at itab WITH control TBL1.
        MODULE POPULATE_TBL.       " populate tbl ctrl
    endloop.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_2700.    " do the sort operations
    loop at itab.
      endloop.
    Hope this helps
    Regards,
    Jayanthi.K

  • Call report selection screen in module pool program with tab strip control

    Hi,
    Could anyone explain in detail to call report selection screen in module pool program with tab strip control.
    Thanks
    Mano

    Hi,
    Refer std program:
    demo_sel_screen_in_tabstrip.
    demo_sel_screen_with_tabstrip.
    Call your program with SUBMIT stmt form module program.
    Reward points if this Helps.
    Manish

  • BDC program for rebate with table controls

    Hi Friends,
    Iam Doing  bdc program for Rebate(TCODE VBO1) with table controls..
    can u give the solutions for table controls...
    if anybody having the code..please send me..
    Thanks & Advance,
    sampath

    hi,
    check this example it may help you.
    REPORT  ZSR_BDC_TBCTRL
            NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES : RF02K,LFA1,LFBK.
    DATA : BEGIN OF IT_VEN OCCURS 0,
          LIFNR LIKE RF02K-LIFNR,
          KTOKK LIKE RF02K-KTOKK,
          NAME1 LIKE LFA1-NAME1,
          SORTL LIKE LFA1-SORTL,
          LAND1 LIKE LFA1-LAND1,
          SPRAS LIKE LFA1-SPRAS,
          BANKS(6) TYPE C,
          BANKL(17) TYPE C,
          BANKN(19) TYPE C,
          END OF IT_VEN.
    DATA : BEGIN OF BANKS OCCURS 0,
           BANKS LIKE LFBK-BANKS,
           END OF BANKS,
           BEGIN OF BANKL OCCURS 0,
           BANKL LIKE LFBK-BANKL,
           END OF BANKL,
           BEGIN OF BANKN OCCURS 0,
           BANKN LIKE LFBK-BANKN,
           END OF BANKN.
    DATA : FLD(20) TYPE C,
           CNT(2) TYPE N.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    INCLUDE BDCRECX1.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'Z:\sr.TXT'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = IT_VEN
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PERFORM OPEN_GROUP.
    LOOP AT IT_VEN.
        REFRESH BDCDATA.
        REFRESH : BANKS,BANKL,BANKN..
        SPLIT IT_VEN-BANKS AT ',' INTO TABLE BANKS.
        SPLIT IT_VEN-BANKL AT ',' INTO TABLE BANKL.
        SPLIT IT_VEN-BANKN AT ',' INTO TABLE BANKN.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                                  IT_VEN-LIFNR.
    PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                  IT_VEN-KTOKK.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                  IT_VEN-NAME1.
    PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                  IT_VEN-SORTL.
    PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                  IT_VEN-LAND1.
    PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                  IT_VEN-SPRAS.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKN(02)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    *perform bdc_field       using 'LFBK-BANKS(01)'
                                 'DE'.
    *perform bdc_field       using 'LFBK-BANKS(02)'
                                 'DE'.
    *perform bdc_field       using 'LFBK-BANKL(01)'
                                 '10020030'.
    *perform bdc_field       using 'LFBK-BANKL(02)'
                                 '67270003'.
    *perform bdc_field       using 'LFBK-BANKN(01)'
                                 '12345'.
    *perform bdc_field       using 'LFBK-BANKN(02)'
                                 '66666'.
    MOVE 1 TO CNT.
        LOOP AT BANKS.
          CONCATENATE 'LFBK-BANKS(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKS-BANKS.
          CNT = CNT + 1.
        ENDLOOP.
        MOVE 1 TO CNT.
        LOOP AT BANKL.
          CONCATENATE 'LFBK-BANKL(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKL-BANKL.
          CNT = CNT + 1.
        ENDLOOP.
        MOVE 1 TO CNT.
        LOOP AT BANKN.
          CONCATENATE 'LFBK-BANKN(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKN-BANKN.
          CNT = CNT + 1.
        ENDLOOP.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=YES'.
    PERFORM BDC_TRANSACTION USING 'XK01'.
    ENDLOOP.
    PERFORM CLOSE_GROUP.&----
    *& Report  ZSR_BDC_TBCTRL
    REPORT  ZSR_BDC_TBCTRL
            NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES : RF02K,LFA1,LFBK.
    DATA : BEGIN OF IT_VEN OCCURS 0,
          LIFNR LIKE RF02K-LIFNR,
          KTOKK LIKE RF02K-KTOKK,
          NAME1 LIKE LFA1-NAME1,
          SORTL LIKE LFA1-SORTL,
          LAND1 LIKE LFA1-LAND1,
          SPRAS LIKE LFA1-SPRAS,
          BANKS(6) TYPE C,
          BANKL(17) TYPE C,
          BANKN(19) TYPE C,
          END OF IT_VEN.
    DATA : BEGIN OF BANKS OCCURS 0,
           BANKS LIKE LFBK-BANKS,
           END OF BANKS,
           BEGIN OF BANKL OCCURS 0,
           BANKL LIKE LFBK-BANKL,
           END OF BANKL,
           BEGIN OF BANKN OCCURS 0,
           BANKN LIKE LFBK-BANKN,
           END OF BANKN.
    DATA : FLD(20) TYPE C,
           CNT(2) TYPE N.
    DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    INCLUDE BDCRECX1.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'Z:\sr.TXT'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = IT_VEN
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PERFORM OPEN_GROUP.
    LOOP AT IT_VEN.
        REFRESH BDCDATA.
        REFRESH : BANKS,BANKL,BANKN..
        SPLIT IT_VEN-BANKS AT ',' INTO TABLE BANKS.
        SPLIT IT_VEN-BANKL AT ',' INTO TABLE BANKL.
        SPLIT IT_VEN-BANKN AT ',' INTO TABLE BANKN.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                                  IT_VEN-LIFNR.
    PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                  IT_VEN-KTOKK.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                  IT_VEN-NAME1.
    PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                  IT_VEN-SORTL.
    PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                  IT_VEN-LAND1.
    PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                  IT_VEN-SPRAS.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKN(02)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    *perform bdc_field       using 'LFBK-BANKS(01)'
                                 'DE'.
    *perform bdc_field       using 'LFBK-BANKS(02)'
                                 'DE'.
    *perform bdc_field       using 'LFBK-BANKL(01)'
                                 '10020030'.
    *perform bdc_field       using 'LFBK-BANKL(02)'
                                 '67270003'.
    *perform bdc_field       using 'LFBK-BANKN(01)'
                                 '12345'.
    *perform bdc_field       using 'LFBK-BANKN(02)'
                                 '66666'.
    MOVE 1 TO CNT.
        LOOP AT BANKS.
          CONCATENATE 'LFBK-BANKS(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKS-BANKS.
          CNT = CNT + 1.
        ENDLOOP.
        MOVE 1 TO CNT.
        LOOP AT BANKL.
          CONCATENATE 'LFBK-BANKL(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKL-BANKL.
          CNT = CNT + 1.
        ENDLOOP.
        MOVE 1 TO CNT.
        LOOP AT BANKN.
          CONCATENATE 'LFBK-BANKN(' CNT ') ' INTO FLD.
          PERFORM BDC_FIELD USING FLD BANKN-BANKN.
          CNT = CNT + 1.
        ENDLOOP.
    PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=ENTR'.
    PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  '=YES'.
    PERFORM BDC_TRANSACTION USING 'XK01'.
    ENDLOOP.
    PERFORM CLOSE_GROUP.

  • Strange issue with table control in dialog programming! Please help!

    Hello everyone:
                I have a table control on screen painter and I have atleast 10 rows on display when user calls the screen. If I have 15 columns then ofcourse user has to scroll down to see extra rows. I have line selection set to "single" for table control so that user can select only one row at a time. This works fine when user does not have to scroll to see extra rows. It is tough for me to explain i.e., if the table control displays 10 rows when the screen opens up then they can only select single row at a time (rows 1 -10). For example user selected row 7 and now they scroll down to see extra rows (for example 13) then it lets them select row 13 also even though I set line selection to "single" in the properties for table control! They should be able to select only one row at a time. Is this some limitation with table control in SAP? Please give me any information you have.
    Thanks.
    Mithun

    Hi,
    As you suspected, this is a limitation in the table control.  You need to take care of the single-selection functionality yourself except for the rows that are actually being displayed.  See [Note 588284|https://service.sap.com/sap/support/notes/588284] for the official SAP explanation.
    Regards,
    Jamie

  • Problem in module pool with table control scrolling

    hi,
    i am using the table control in module pool,in the table control i have radion button for all the rows.
    After i got the data into the table control ,if i select radio button and if i press vertical scroll bar button, that radio button is deselecting,how to solve this issue.
    Please help me.

    Hi
    Generally we don't keep radiobuttons in table control for selecting the records
    We keep check boxes for selecting the records
    Radio button is used to select a single from a group of records and at a time only one is selected, where as checkboxes at a time you can select a single or multiple.
    So use checkboxes and code correctly see the doc for Table control
    syntax:
    CONTROLS .
    if you only want to determine the row of the table control. SY´-SUBRC allows you to check if the cursor is placed in a row of a table control.
    u need to comment the performs of table control fields and write ur own perform statements. And u have to declare the table control fields as separate internal tables.
    Go through this urls.
    www.****************
    www.sap-img.com
    Check the below links.
    http://www.planetsap.com/howdo_a.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
    http://sap.niraj.tripod.com/id25.html
    Reward points if useful
    Regards
    Anji

  • How to take backup of an entire module pool program with code,screen,etc.

    Hi experts,
    I have some important data in the ides server for which i want to take backup of them.
    I have some question regarding the same.
    1.How to take backup/download of an entire module pool program with code,screen,etc.
    2.How can we take backup/download for a DB table with its structure?
    3.How can we take backup of a search help?
    Please give some suggestions abt the same.
    Regards,
    Ashesh.

    Hi,
    May be just for viewing, try downloading from SE80 transaction from the others option.
    Here just try issuing the print, it will generate the spool.
    Now using the spool, download to your desktop as required. It will have all the information regarding the attributes, fields, elements everything.
    The only issue is, may be you need to take all the screens separately.
    Regards,
    Santhosh.

  • Program for table control in bdc

    Hi All,
        Can Anybody provide me program on table control that used in BDC.
        Please provide me program also.
    thanks
    rahul.

    Hi,
    Check this sample code:
    report zcustomer_change_bict
           no standard page heading line-size 255.
    include bdcrecx1.
    data: begin of it_record occurs 0,
            kunnr like rf02d-kunnr,
            d0360 like rf02d-d0360,
            anred(30) type c,
            name1(35) type c,
            namev(35) type c,
            telf1(35) type c,
            abtnr(10) type c,
          end of it_record.
    data: begin of it_knvk1 occurs 0,
          anred like knvk-anred,
          end of it_knvk1.
    data: begin of it_knvk2 occurs 0,
          name1 like knvk-name1,
          end of it_knvk2.
    data: begin of it_knvk3 occurs 0,
          namev like knvk-namev,
          end of it_knvk3.
    data: begin of it_knvk4 occurs 0,
          telf1 like knvk-telf1,
          end of it_knvk4.
    data: begin of it_knvk5 occurs 0,
          abtnr like knvk-abtnr,
          end of it_knvk5.
    data : fld(20) type c,
           cnt(2) type n.
    start-of-selection.
      call function 'GUI_UPLOAD'
        exporting
          filename                      = 'C:\CUSTCH.TXT'
         filetype                      = 'ASC'
        has_field_separator            = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    = FILELENGTH
      HEADER                        = HEADER
        tables
          data_tab                      = it_record
    exceptions
       file_open_error               = 1
       file_read_error               = 2
       no_batch                      = 3
       gui_refuse_filetransfer       = 4
       invalid_type                  = 5
       no_authority                  = 6
       unknown_error                 = 7
       bad_data_format               = 8
       header_not_allowed            = 9
       separator_not_allowed         = 10
       header_too_long               = 11
       unknown_dp_error              = 12
       access_denied                 = 13
       dp_out_of_memory              = 14
       disk_full                     = 15
       dp_timeout                    = 16
       others                        = 17
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      perform open_group.
      loop at it_record.
        refresh bdcdata.
        refresh: it_knvk1,it_knvk2,it_knvk3,it_knvk4,it_knvk5.
        split it_record-anred at ',' into table it_knvk1.
        split it_record-name1 at ',' into table it_knvk2.
        split it_record-namev at ',' into table it_knvk3.
        split it_record-telf1 at ',' into table it_knvk4.
        split it_record-abtnr at ',' into table it_knvk5.
    screen 101
        perform bdc_dynpro      using 'SAPMF02D' '0101'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RF02D-D0360'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'RF02D-KUNNR'
                                      it_record-kunnr.
        perform bdc_field       using 'RF02D-D0360'
                                      it_record-d0360.
    screen 360
        perform bdc_dynpro      using 'SAPMF02D' '0360'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'KNVK-ABTNR(01)'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=ENTR'.
    *perform bdc_field       using 'KNVK-ANRED(01)'
                                 record-ANRED_01_003.
    *perform bdc_field       using 'KNVK-NAMEV(01)'
                                 record-NAMEV_01_004.
    *perform bdc_field       using 'KNVK-NAME1(01)'
                                 record-NAME1_01_005.
    *perform bdc_field       using 'KNVK-TELF1(01)'
                                 record-TELF1_01_006.
    *perform bdc_field       using 'KNVK-ABTNR(01)'
                                 record-ABTNR_01_007.
        move 1 to cnt.
        loop at it_knvk1 .
          concatenate 'knvk-anred( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk1-anred.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk2 .
          concatenate 'knvk-name1( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk2-name1.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk3 .
          concatenate 'knvk-namev( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk3-namev.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk4 .
          concatenate 'knvk-telf1( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk4-telf1.
          cnt = cnt + 1.
        endloop.
        move 1 to cnt.
        loop at it_knvk5 .
          concatenate 'knvk-abtnr( ' cnt ' ) ' into fld.
          perform bdc_field using fld it_knvk5-abtnr.
          cnt = cnt + 1.
        endloop.
    screen 360
        perform bdc_dynpro      using 'SAPMF02D' '0360'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'KNVK-NAMEV(01)'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=ENTR'.
        perform bdc_transaction using 'XD02'.
      endloop.
      perform close_group.

  • How to create bdc with table control

    hi all.
    please some body tell me how to create bdc with table control
    or suggest any www with screen shots
    thanks in advance ,
    aparna

    Hi AParna,
    Its very Simple.
    ALl you have to do is set up a counter based on the number of lines in the tabke. when the counter reaches the number of lines in the table hit the next page button which is at the top of every screen in SAP.
    Please refer to the following BDC program I had developed using Table control,
    this is for ME01 transaction.
      LOOP AT T_EORD_HED.
        SELECT SINGLE * FROM MARA WHERE MATNR = T_EORD_HED-MATNR.
        IF SY-SUBRC = 0.
          PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0200'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EORD-MATNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'EORD-MATNR'
                                        T_EORD_HED-MATNR.       "'58335'.
          PERFORM BDC_FIELD       USING 'EORD-WERKS'
                                        T_EORD_HED-WERKS.       "'0253'.
          L_COUNT = 1.
          LOOP AT T_EORD WHERE MATNR = T_EORD_HED-MATNR
                           AND WERKS = T_EORD_HED-WERKS.
            SELECT SINGLE * FROM LFA1 WHERE LIFNR = T_EORD-LIFNR.
            IF SY-SUBRC = 0.
    * Look into the if condition below
              IF L_COUNT = 010.
                L_COUNT = 1.
                PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0205'.
                PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'EORD-MATNR'.
                PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=NS'.
                L_COUNT = L_COUNT + 1.
              ENDIF.
              PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0205'.
              PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                            'EORD-AUTET(01)'.
              PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                            '/00'.
              CONCATENATE 'EORD-VDATU' '(' L_COUNT ')' INTO OPR_FIELD.
              WRITE SY-DATUM TO T_EORD-VDATU.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-VDATU.
              CONCATENATE 'EORD-BDATU' '(' L_COUNT ')' INTO OPR_FIELD.
              WRITE T_EORD-BDATU TO V_BDATU.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            V_BDATU.
              CONCATENATE 'EORD-LIFNR' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-LIFNR.
              CONCATENATE 'EORD-EKORG' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            '0001'.
              CONCATENATE 'EORD-RESWK' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-RESWK.
              WRITE T_EORD-MEINS TO V_MEINS.
              CONCATENATE 'EORD-MEINS' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            V_MEINS.
    *          CONCATENATE 'EORD-EBELN' '(' L_COUNT ')' INTO OPR_FIELD.
    *          PERFORM BDC_FIELD       USING 'OPR_FIELD'
    *                                        T_EORD-EBELN.
              CONCATENATE 'EORD-EBELP' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-EBELP.
              IF T_EORD-FLIFN NE SPACE OR T_EORD-FRESW NE SPACE OR
                 T_EORD-FEBEL NE SPACE.
                CONCATENATE 'RM06W-FESKZ' '(' L_COUNT ')' INTO OPR1_FIELD.
                PERFORM BDC_FIELD       USING OPR1_FIELD
                                              'X'.
              ENDIF.
              IF T_EORD-NOTKZ <> ''.
                CONCATENATE 'EORD-NOTKZ' '(' L_COUNT ')' INTO OPR_FIELD.
                PERFORM BDC_FIELD       USING OPR_FIELD
                                              'X'.
              ENDIF.
              CONCATENATE 'EORD-AUTET' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-AUTET.
              L_COUNT = L_COUNT + 1.
            ENDIF.
          ENDLOOP.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EORD-MATNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=BU'.
          CALL TRANSACTION 'ME01' USING I_BDCDATA
                        MODE UP_MODE
    *                     optIONS  FROM l_opt
                        MESSAGES INTO I_BDCMSGCOLL.
          PERFORM FORMAT_OUTPUT.
        ENDIF.
      ENDLOOP.

  • ABAP HR How to create infotype with table control in it like Infotype 0008

    Hi Experts.
    I need help from u guys. My client requirement is to create custom infotype just like 0008 infotype which contain table control to save amount and wage types. I try to create infotype with table control using PM01, but that table control is in display mode only, i almost search every where to create custom infotype with table control but what ever threads in forum all are they unanswered and most of the threads for creating infotype. But i already done with infotype , but my main problem is table control.
    If any one have some suggestion for this please share with me.
    <removed by moderator> i am looking for positive reply.
    Edited by: Thomas Zloch on Aug 30, 2011 12:54 PM

    Hi
    I've created several infotypes with a Table Control and it is always the same story. You have to create a custom Z table to store the Table Control data (if you can have unlimited records), so in the PSXXXX structure you need to add a TABNR field to link the PAXXXX table and the Z one, just like the type table OM infotypes.
    Then in your code you have to control every possible operation, INS, MOD, DEL... and update the Z table accordingly (the standard code won't do that)
    If your TC fields appear in display mode, take a look at the Groups 1 and 3 in your fields, the must be set with the usual values for a PA infotype.
    If you have more questions, just ask,
    Regards

  • How can I work lsmw with table control using mm01 appl?

    Hi
    How can I work lsmw with table control using mm01 appl?
    Is it difefrent the way we handle table control in BDC?
    Thank You

    Hi
    How can I work lsmw with table control using mm01 appl?
    Is it difefrent the way we handle table control in BDC?
    Thank You

  • Problem with Table control lines

    Hi Friends,
    This is the problem with table control lines:
    I have screen with table control and I would like change the table control lines dynamicaly.
    Exp:
    In my PBO the Internal table which I am using to loop the TC is havig 7 records and its displayed with 7 records, now I have added one more record into my ITAB and now ITAB is having 8 records, when I am looping this ITAB with TC its taking the TC lines 7 only.
    here is the code:
    Initial values in gt_scr400 = 8
    Initial values in tc_scr400 = 8
    Now added one more recor into gt_scr400 , now gt_scr400  = 9.
      LOOP AT   gt_scr400
           INTO wa_scr400
           WITH CONTROL tc_scr400
           CURSOR tc_scr400-current_line.
      ENDLOOP.
    I have used this logic :
      DESCRIBE TABLE gt_scr400 LINES g_rec_300 .
      tc_scr300-lines = g_rec_300.
    but its not modifying the lines in my table control.
    How to change the TC lines based on ITAB total records.
    Thanks,
    Sridhar

    there is a field in TableViewName-xxx
    don't remember the exact field name for (total no of records)
    you can check it in debug.  when you add records in Internal table, u need to modify this field which is set at the first time when table control is populated.

  • Select-option in module pool  with table Control

    HI,
    How to use the select-option in Module Pool and how Can i use the Table control in it.
    Can any body give me some Clues.
    with rgds
    Ranjith

    Hi ..
    PBO.
    LOOP at <table contriol>
    module --- Inside the module
    DATA: g_uti TYPE REF TO cl_fobu_input_util.
      if rollname <> space.
         CREATE OBJECT g_uti
           EXPORTING typename =rollname.
    *....convert to external pattern
         CALL METHOD g_util->output_convert
           EXPORTING
             field_value_int = p_value                 " This is Tablecontrol-low
           IMPORTING
             field_value_ext = p_value.              " Retrun value for Low
    ENDLOOP.
    lly you have code in PAI
    DATA: g_util_1 TYPE REF TO cl_fobu_input_util.
      if rollname <> space.
         CREATE OBJECT g_util_1
           EXPORTING typename = rollname.
    *....convert to internal pattern
         CALL METHOD g_util_1->input_convert
           EXPORTING
             field_value_ext   = p_value
           IMPORTING
             field_value_int_c = p_value.
    The above code should be written for tablecontrol-high aswell..
    you can also refer: Inlcude LSE16NF10 line no 341 & 434 (SE16n)
    Nag

  • Module Pool with Table Control.

    Hi,
    I have developed two screens .
    in the first screen the user enters the data and press the Next Push button then
    in the second screen it should display data in the table control.
    For that purpose I have written code.
    when the user press Next Button then I wrote like this.
    case ok_code.
       when 'NEXT'.
            CALL SCREEN '9001'.
    ENDCASE.
    AND In the PBO Event of the Screen 9001 I have written a Function Module to Popup the data
    in the table control.
    But the problem is when the user press the Next Button it is displaying table control without
    data. But when the press the Back button and again he press the Next Button then it is displaying.
    So, Where is the Problem ?
    How can I correct it ?
    Bye,
    Satya.

    Hi
    IN PAI
    case ok_code.
    when 'NEXT'.
    select the data into an internal table using the entered fields in the first screen.
    so data is there in ITAB.
    CALL SCREEN '9001'.
    ENDCASE.
    in PBO.
    between loop..
    MOVE the internal table data to the table control fields
    endloop.
    see the help for TC
    syntax:
    CONTROLS .
    if you only want to determine the row of the table control. SY´-SUBRC allows you to check if the cursor is placed in a row of a table control.
    u need to comment the performs of table control fields and write ur own perform statements. And u have to declare the table control fields as separate internal tables.
    Go through this urls.
    www.****************
    www.sap-img.com
    Check the below links.
    http://www.planetsap.com/howdo_a.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
    http://sap.niraj.tripod.com/id25.html
    Reward points for useful Answers
    Regards
    Anji

  • Module pool prorgam in table control designing

    Hi ,
    I have created the table control in module pool program.(Screen added in VA01 header level under addition data2)
    I have given the option for table control for Single line selection and W/Sel colum .
    My requirement is if i enter the data in table cotrol( SO creation)  or if data alreday Coming in table cotrol  (for So Change mode).Should allow to select the row.if table control doesn't have data for line wise.shouldn't t allow to select the Row selection.
    I tried to set the table control line selection mode option with  TABLE1-LINE_SEL_MODE = 0 through program.Its not allowing to select any row like with data also not allowing  to select and without data also its not allowing to select the data.
    How to set the functinality for same.
    Its very urgent Requirement.
    Regards
    DIvakar Reddy K.

    Hi Divakar,
    In the PBO of the screen, you need to write below code:
      PROCESS BEFORE OUTPUT.
      MODULE STATUS_0100.
        LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.
      ENDLOOP.
    Please refer to program DEMO_DYNPRO_TABCONT_LOOP_AT.

Maybe you are looking for