Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Please copy paste program and activate.

It will help to download any Y Z table or Structures from one business client to other client . It will automatically create the table.

 

*&---------------------------------------------------------------------*
*& Report  YFI_NIP
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

*table for package : V_TDEVC

REPORT  YCREATE_TABLE.

DATA LT_FIELDS TYPE TABLE OF DD03P,
       WA_FIELD TYPE DD03P,
       TABLE_HEADER TYPE DD02V,
       TECHN_SET TYPE DD09V.

DATA GOTSTATE TYPE  DDGOTSTATE,
       DD02V_WA TYPE  DD02V,
       DD09L_WA TYPE  DD09V.
DATA L_NAME TYPE  DDOBJNAME.
DATA DD03P_TAB LIKE  DD03P  OCCURS WITH HEADER LINE.

DATA WA_3PTAB TYPE DD03P.

DATA IT_PACK LIKE TDEVC OCCURS WITH HEADER LINE.

DATA W_PACKAGE LIKE TDEVC-DEVCLASS.

DATA DFIES_TAB LIKE  DFIES OCCURS WITH HEADER LINE.

DATA DD01V_WA TYPE  DD01V.
DATA DD07V_TAB LIKE DD07V OCCURS WITH HEADER LINE.
DATA DD07V_TAB_DOWN LIKE DD07V OCCURS WITH HEADER LINE.
DATA WA_DD07V TYPE DD07V.

DATA:BDCDATA LIKE BDCDATA    OCCURS WITH HEADER LINE.

DATA DD04V_WA TYPE  DD04V.

TYPESBEGIN OF ST_HEADER,
     FIELDNAME(100),
     END OF ST_HEADER.

DATA WA_HEADER TYPE ST_HEADER,
       IT_HEADER TYPE STANDARD TABLE OF ST_HEADER.
DATA:LD_FILENAME TYPE STRING,
     LD_PATH     TYPE STRING,
     LD_FULLPATH TYPE STRING,
     LD_RESULT   TYPE I.

DATA W_FILE TYPE STRING.

DATAIT_UPLOAD TYPE ALSMEX_TABLINE OCCURS WITH HEADER LINE,
      WA_UPLOAD  LIKE IT_UPLOAD.


DATAGV_REQ_NO TYPE E070-TRKORR,
      GT_AUTHORLIST  TYPE TABLE OF BAPISCTS12,
      GS_AUTHORLIST  TYPE BAPISCTS12,
      GT_TASK_LIST  TYPE TABLE OF BAPISCTS07.


DATA WA_OPTIONS TYPE CTU_PARAMS ,
     IT_MESSTAB LIKE BDCMSGCOLL OCCURS WITH HEADER LINE,
     WA_MESSTAB LIKE BDCMSGCOLL.

DATA W_REQDESC LIKE  E07T-AS4TEXT.


********************************************************************
SELECTION-SCREEN:BEGIN OF BLOCK A2 WITH FRAME TITLE  TEXT-002.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERSP_CRT   RADIOBUTTON    GROUP GR1 USER-COMMAND COM DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(26PCLIC.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.


PARAMETERS:   P_DOWN   RADIOBUTTON    GROUP GR1.

SELECTION-SCREEN COMMENT 5(50PCLIC2.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN:END OF BLOCK A2.


SELECTION-SCREEN:BEGIN OF BLOCK A1 WITH FRAME TITLE  TEXT-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(32PCLIC3.

PARAMETERS P_TAB LIKE RSRD1-TBMA_VAL .

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(32PCLIC4 MODIF ID DIS.

PARAMETERS P_FILE(128MODIF ID DIS .
SELECTION-SCREEN END OF LINE.


SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(32PCLIC5 MODIF ID DIS.

PARAMETERS FILE_DOM(128MODIF ID DIS.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF LINE.



PARAMETERSR_TABLE   RADIOBUTTON    GROUP GR2 USER-COMMAND COM DEFAULT 'X' MODIF ID DIS.
SELECTION-SCREEN COMMENT 5(50PCLIC6 MODIF ID DIS.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERSR_STRUCT   RADIOBUTTON    GROUP GR2 MODIF ID DIS.
SELECTION-SCREEN COMMENT 5(50PCLIC7 MODIF ID DIS.
SELECTION-SCREEN END OF LINE.


SELECTION-SCREEN SKIP.


SELECTION-SCREEN:END OF BLOCK A1.


INITIALIZATION.
  MOVE 'Create Table' TO PCLIC.
  MOVE 'Download Table/Structure Details' TO PCLIC2.
  MOVE 'Table Name' TO PCLIC3.
  MOVE 'Enter File Name' TO PCLIC4.
  MOVE 'Enter File Name for Value Range' TO PCLIC5.

  MOVE 'Table' TO PCLIC6.
  MOVE 'Structure' TO PCLIC7.


AT SELECTION-SCREEN OUTPUT.
  IF P_DOWN 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 'DIS'.
        SCREEN-ACTIVE 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

  ELSE.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 'DIS'.
        SCREEN-ACTIVE 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

  ENDIF.


************************************************************
*   At selection screen events                             *
************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

  PERFORM GET_FILE USING P_FILE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE_DOM.

  PERFORM GET_FILE2 USING FILE_DOM.




START-OF-SELECTION.

  IF P_TAB IS INITIAL.
    MESSAGE E001(00WITH 'Pls enter table name'.
  ELSE.
    IF P_TAB+0(1NE 'Y' AND   P_TAB+0(1NE 'Z'.
      MESSAGE E001(00WITH 'Pls enter Y or Z initial in table name'.
    ENDIF.
  ENDIF.



  IF P_DOWN 'X'.
    PERFORM DOWN_LOAD_TABLE.

  ELSE.
***Upload From Excel To Itab
    IF P_FILE IS INITIAL.
      MESSAGE E001(00WITH 'Pls enter file name'.
    ENDIF.


    SELECT FROM TDEVC INTO TABLE IT_PACK WHERE DEVCLASS LIKE 'Z%'.

    LOOP AT IT_PACK.
      IF IT_PACK-DEVCLASS+0(2'ZA'  OR IT_PACK-DEVCLASS+0(2'ZM'.
        W_PACKAGE IT_PACK-DEVCLASS.
        EXIT.
      ENDIF.
    ENDLOOP.

    IF W_PACKAGE IS INITIAL.
      SELECT FROM TDEVC INTO TABLE IT_PACK WHERE DEVCLASS LIKE 'Y%'.

      LOOP AT IT_PACK.
        IF IT_PACK-DEVCLASS+0(2'YA'  OR IT_PACK-DEVCLASS+0(2'YM'.
          W_PACKAGE IT_PACK-DEVCLASS.
          EXIT.
        ENDIF.
      ENDLOOP.

    ENDIF.


    PERFORM UPLOAD USING P_FILE.
    PERFORM UPLOAD2 USING FILE_DOM.

***Call Transaction method
    PERFORM CHECK_DOMAIN.
    PERFORM CHECK_DELE.
    PERFORM CREATE_TABLE.

  ENDIF.


*&---------------------------------------------------------------------*
*&      Form  GET_FILE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_P_FILE  text
*----------------------------------------------------------------------*
FORM GET_FILE  USING    P_P_FILE.

  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    CHANGING
      FILE_NAME P_FILE.

ENDFORM.                    " GET_FILE
*&---------------------------------------------------------------------*
*&      Form  DOWN_LOAD_TABLE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM DOWN_LOAD_TABLE .



  L_NAME P_TAB.

  CALL FUNCTION 'DDIF_TABL_GET'
    EXPORTING
      NAME          L_NAME
      STATE         'A'
      LANGU         SY-LANGU
    IMPORTING
      GOTSTATE      GOTSTATE
      DD02V_WA      DD02V_WA
      DD09L_WA      DD09L_WA
    TABLES
      DD03P_TAB     DD03P_TAB
*     DD05M_TAB     =
*     DD08V_TAB     =
*     DD12V_TAB     =
*     DD17V_TAB     =
*     DD35V_TAB     =
*     DD36M_TAB     =
    EXCEPTIONS
      ILLEGAL_INPUT 1
      OTHERS        2.
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.


  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      TABNAME              'DD03P'
*   FIELDNAME            = ' '
     LANGU                SY-LANGU
*   LFIELDNAME           = ' '
*   ALL_TYPES            = ' '
*   GROUP_NAMES          = ' '
*   UCLEN                =
*   DO_NOT_WRITE         = ' '
* IMPORTING
*   X030L_WA             =
*   DDOBJTYPE            =
*   DFIES_WA             =
*   LINES_DESCR          =
   TABLES
     DFIES_TAB            DFIES_TAB
*   FIXED_VALUES         =
* EXCEPTIONS
*   NOT_FOUND            = 1
*   INTERNAL_ERROR       = 2
*   OTHERS               = 3
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.


  LOOP AT DFIES_TAB.
    WA_HEADER-FIELDNAME DFIES_TAB-FIELDNAME  .
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR :WA_HEADER.
  ENDLOOP.


* DISPLAY SAVE DIALOG WINDOW

  CONCATENATE 'Table' P_TAB INTO W_FILE SEPARATED BY SPACE.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
      WINDOW_TITLE      W_FILE
      DEFAULT_EXTENSION 'XLS'
      DEFAULT_FILE_NAME W_FILE
    CHANGING
      FILENAME          LD_FILENAME
      PATH              LD_PATH
      FULLPATH          LD_FULLPATH
      USER_ACTION       LD_RESULT.


  CHECK LD_RESULT EQ '0'.

*-- Download to excel sheet.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME              LD_FULLPATH
      FILETYPE              'ASC'
      WRITE_FIELD_SEPARATOR 'X'
    TABLES
      DATA_TAB              DD03P_TAB
      FIELDNAMES            IT_HEADER
    EXCEPTIONS
      FILE_OPEN_ERROR       1
      FILE_WRITE_ERROR      2
      OTHERS                3.


  CLEAR DD07V_TAB_DOWN.
  REFRESH DD07V_TAB_DOWN.

  LOOP AT DD03P_TAB WHERE VALEXI 'X'.

    IF DD03P_TAB-DOMNAME+0(1'Z' OR DD03P_TAB-DOMNAME+0(1'Y'.

      CALL FUNCTION 'DDIF_DOMA_GET'
        EXPORTING
          NAME          DD03P_TAB-DOMNAME
          STATE         'A'
          LANGU         SY-LANGU
        IMPORTING
*         GOTSTATE      =
          DD01V_WA      DD01V_WA
        TABLES
          DD07V_TAB     DD07V_TAB
        EXCEPTIONS
          ILLEGAL_INPUT 1
          OTHERS        2.
    ENDIF.

    LOOP AT DD07V_TAB.
      DD07V_TAB_DOWN DD07V_TAB.
      APPEND DD07V_TAB_DOWN.
    ENDLOOP.

  ENDLOOP.

  CLEAR DFIES_TAB.
  REFRESH DFIES_TAB.
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      TABNAME              'DD07V'
*   FIELDNAME            = ' '
     LANGU                SY-LANGU
*   LFIELDNAME           = ' '
*   ALL_TYPES            = ' '
*   GROUP_NAMES          = ' '
*   UCLEN                =
*   DO_NOT_WRITE         = ' '
* IMPORTING
*   X030L_WA             =
*   DDOBJTYPE            =
*   DFIES_WA             =
*   LINES_DESCR          =
   TABLES
     DFIES_TAB            DFIES_TAB
*   FIXED_VALUES         =
* EXCEPTIONS
*   NOT_FOUND            = 1
*   INTERNAL_ERROR       = 2
*   OTHERS               = 3
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  CLEAR IT_HEADER,IT_HEADER[].

  LOOP AT DFIES_TAB.
    WA_HEADER-FIELDNAME DFIES_TAB-FIELDNAME  .
    APPEND WA_HEADER TO IT_HEADER.
    CLEAR :WA_HEADER.
  ENDLOOP.

* DISPLAY SAVE DIALOG WINDOW

  CONCATENATE 'Value Range for Domains in Table' P_TAB INTO W_FILE SEPARATED BY SPACE.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
      WINDOW_TITLE      W_FILE
      DEFAULT_EXTENSION 'XLS'
      DEFAULT_FILE_NAME W_FILE
    CHANGING
      FILENAME          LD_FILENAME
      PATH              LD_PATH
      FULLPATH          LD_FULLPATH
      USER_ACTION       LD_RESULT.


  CHECK LD_RESULT EQ '0'.

*-- Download to excel sheet.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME              LD_FULLPATH
      FILETYPE              'ASC'
      WRITE_FIELD_SEPARATOR 'X'
    TABLES
      DATA_TAB              DD07V_TAB_DOWN
      FIELDNAMES            IT_HEADER
    EXCEPTIONS
      FILE_OPEN_ERROR       1
      FILE_WRITE_ERROR      2
      OTHERS                3.


ENDFORM.                    " DOWN_LOAD_TABLE
*&---------------------------------------------------------------------*
*&      Form  UPLOAD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_P_FILE  text
*----------------------------------------------------------------------*
FORM UPLOAD  USING    P_P_FILE.

  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                P_P_FILE
      I_BEGIN_COL             1
      I_BEGIN_ROW             2
      I_END_COL               70
      I_END_ROW               9999
    TABLES
      INTERN                  IT_UPLOAD
    EXCEPTIONS
      INCONSISTENT_PARAMETERS 1
      UPLOAD_OLE              2
      OTHERS                  3.



  IF IT_UPLOAD[] IS INITIAL.
    MESSAGE 'No data Uploaded' TYPE 'I'.
  ENDIF.

  LOOP AT IT_UPLOAD INTO WA_UPLOAD.
    CASE WA_UPLOAD-COL.
      WHEN '0001'.
        WA_3PTAB-TABNAME WA_UPLOAD-VALUE.

      WHEN '0002'.
        WA_3PTAB-FIELDNAME WA_UPLOAD-VALUE.

      WHEN '0003'.
        WA_3PTAB-DDLANGUAGE WA_UPLOAD-VALUE.

      WHEN '0004'.
        WA_3PTAB-POSITION WA_UPLOAD-VALUE.

      WHEN '0005'.
        WA_3PTAB-KEYFLAG WA_UPLOAD-VALUE.

      WHEN '0006'.
        WA_3PTAB-MANDATORY WA_UPLOAD-VALUE.

      WHEN '0007'.
        WA_3PTAB-ROLLNAME WA_UPLOAD-VALUE.

      WHEN '0008'.
        WA_3PTAB-CHECKTABLE WA_UPLOAD-VALUE.

      WHEN '0009'.
        WA_3PTAB-ADMINFIELD WA_UPLOAD-VALUE.

      WHEN '0010'.
        WA_3PTAB-INTTYPE WA_UPLOAD-VALUE.

      WHEN '0011'.
        WA_3PTAB-INTLEN WA_UPLOAD-VALUE.

      WHEN '0012'.
        WA_3PTAB-REFTABLE WA_UPLOAD-VALUE.

      WHEN '0013'.
        WA_3PTAB-PRECFIELD WA_UPLOAD-VALUE.

      WHEN '0014'.
        WA_3PTAB-REFFIELD WA_UPLOAD-VALUE.

      WHEN '0015'.
        WA_3PTAB-CONROUT WA_UPLOAD-VALUE.

      WHEN '0016'.
        WA_3PTAB-NOTNULL WA_UPLOAD-VALUE.

      WHEN '0017'.
        WA_3PTAB-DOMNAME WA_UPLOAD-VALUE.

      WHEN '0018'.
        WA_3PTAB-ROUTPUTLEN WA_UPLOAD-VALUE.

      WHEN '0019'.
        WA_3PTAB-MEMORYID WA_UPLOAD-VALUE.

      WHEN '0020'.
        WA_3PTAB-LOGFLAG WA_UPLOAD-VALUE.
********************************
      WHEN '0021'.
        WA_3PTAB-HEADLEN WA_UPLOAD-VALUE.

      WHEN '0022'.
        WA_3PTAB-SCRLEN1 WA_UPLOAD-VALUE.

      WHEN '0023'.
        WA_3PTAB-SCRLEN2 WA_UPLOAD-VALUE.

      WHEN '0024'.
        WA_3PTAB-SCRLEN3 WA_UPLOAD-VALUE.

      WHEN '0025'.
        WA_3PTAB-DTELGLOBAL WA_UPLOAD-VALUE.

      WHEN '0026'.
        WA_3PTAB-DTELMASTER WA_UPLOAD-VALUE.

      WHEN '0027'.
        WA_3PTAB-RESERVEDTE WA_UPLOAD-VALUE.

      WHEN '0028'.
        WA_3PTAB-DATATYPE WA_UPLOAD-VALUE.

      WHEN '0029'.
        WA_3PTAB-LENG WA_UPLOAD-VALUE.

      WHEN '0030'.
        WA_3PTAB-OUTPUTLEN WA_UPLOAD-VALUE.

      WHEN '0031'.
        WA_3PTAB-DECIMALS WA_UPLOAD-VALUE.

      WHEN '0032'.
        WA_3PTAB-LOWERCASE WA_UPLOAD-VALUE.

      WHEN '0033'.
        WA_3PTAB-SIGNFLAG WA_UPLOAD-VALUE.

      WHEN '0034'.
        WA_3PTAB-LANGFLAG WA_UPLOAD-VALUE.

      WHEN '0035'.
        WA_3PTAB-VALEXI WA_UPLOAD-VALUE.

      WHEN '0036'.
        WA_3PTAB-ENTITYTAB WA_UPLOAD-VALUE.

      WHEN '0037'.
        WA_3PTAB-CONVEXIT WA_UPLOAD-VALUE.

      WHEN '0038'.
        WA_3PTAB-MASK WA_UPLOAD-VALUE.

      WHEN '0039'.
        WA_3PTAB-MASKLEN WA_UPLOAD-VALUE.

      WHEN '0040'.
        WA_3PTAB-ACTFLAG WA_UPLOAD-VALUE.

      WHEN '0041'.
        WA_3PTAB-DDTEXT WA_UPLOAD-VALUE.

      WHEN '0042'.
        WA_3PTAB-REPTEXT WA_UPLOAD-VALUE.

      WHEN '0043'.
        WA_3PTAB-SCRTEXT_S WA_UPLOAD-VALUE.

      WHEN '0044'.
        WA_3PTAB-SCRTEXT_M WA_UPLOAD-VALUE.

      WHEN '0045'.
        WA_3PTAB-SCRTEXT_L WA_UPLOAD-VALUE.

      WHEN '0046'.
        WA_3PTAB-DOMMASTER WA_UPLOAD-VALUE.

      WHEN '0047'.
        WA_3PTAB-RESERVEDOM WA_UPLOAD-VALUE.

      WHEN '0048'.
        WA_3PTAB-DOMGLOBAL WA_UPLOAD-VALUE.

      WHEN '0049'.
        WA_3PTAB-DOMNAME3L WA_UPLOAD-VALUE.

      WHEN '0050'.
        WA_3PTAB-SHLPORIGIN WA_UPLOAD-VALUE.

      WHEN '0051'.
        WA_3PTAB-SHLPNAME WA_UPLOAD-VALUE.

      WHEN '0052'.
        WA_3PTAB-SHLPFIELD WA_UPLOAD-VALUE.

      WHEN '0053'.
        WA_3PTAB-TABLETYPE WA_UPLOAD-VALUE.

      WHEN '0054'.
        WA_3PTAB-DEPTH WA_UPLOAD-VALUE.

      WHEN '0055'.
        WA_3PTAB-COMPTYPE WA_UPLOAD-VALUE.

      WHEN '0056'.
        WA_3PTAB-DEFFDNAME WA_UPLOAD-VALUE.

      WHEN '0057'.
        WA_3PTAB-GROUPNAME WA_UPLOAD-VALUE.

      WHEN '0058'.
        WA_3PTAB-REFTYPE WA_UPLOAD-VALUE.

      WHEN '0059'.
        WA_3PTAB-PROXYTYPE WA_UPLOAD-VALUE.

      WHEN '0060'.
        WA_3PTAB-LANGUFLAG WA_UPLOAD-VALUE.

      WHEN '0061'.
        WA_3PTAB-EXCLASS WA_UPLOAD-VALUE.

      WHEN '0062'.
        WA_3PTAB-LTRFLDDIS WA_UPLOAD-VALUE.

      WHEN '0063'.
        WA_3PTAB-BIDICTRLC WA_UPLOAD-VALUE.

      WHEN '0064'.
        WA_3PTAB-DBPOSITION WA_UPLOAD-VALUE.

      WHEN '0065'.
        WA_3PTAB-ANONYMOUS WA_UPLOAD-VALUE.

      WHEN '0066'.
        WA_3PTAB-OUTPUTSTYLE WA_UPLOAD-VALUE.

      WHEN '0067'.
        WA_3PTAB-NOHISTORY WA_UPLOAD-VALUE.

      WHEN '0068'.
        WA_3PTAB-AMPMFORMAT WA_UPLOAD-VALUE.

      WHEN '0069'.
        WA_3PTAB-STREAMORLOC WA_UPLOAD-VALUE.

      WHEN '0070'.
        WA_3PTAB-STRORLOCPOS WA_UPLOAD-VALUE.


    ENDCASE.

    AT  END OF ROW.
      APPEND  WA_3PTAB TO DD03P_TAB.
      CLEAR WA_3PTAB.
    ENDAT.
  ENDLOOP.

ENDFORM.                    " UPLOAD
*&---------------------------------------------------------------------*
*&      Form  CHECK_DOMAIN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM CHECK_DOMAIN .

  LOOP AT DD03P_TAB.

    IF DD03P_TAB-DOMNAME+0(1'Z' OR DD03P_TAB-DOMNAME+0(1'Y'.

      CALL FUNCTION 'DDIF_DOMA_GET'
        EXPORTING
          NAME          DD03P_TAB-DOMNAME
          STATE         'A'
          LANGU         SY-LANGU
        IMPORTING
*         GOTSTATE      =
          DD01V_WA      DD01V_WA
        TABLES
          DD07V_TAB     DD07V_TAB
        EXCEPTIONS
          ILLEGAL_INPUT 1
          OTHERS        2.


      IF DD01V_WA IS INITIAL.

        MOVE-CORRESPONDING DD03P_TAB TO DD01V_WA.


        IF DD03P_TAB-VALEXI 'X'.
          CLEAR DD07V_TAB.
          REFRESH DD07V_TAB.

          LOOP AT DD07V_TAB_DOWN WHERE DOMNAME DD03P_TAB-DOMNAME.
            DD07V_TAB DD07V_TAB_DOWN.
            APPEND DD07V_TAB.
            CLEAR DD07V_TAB.
          ENDLOOP.

        ENDIF.

        CALL FUNCTION 'DDIF_DOMA_PUT'
          EXPORTING
            NAME              DD03P_TAB-DOMNAME
            DD01V_WA          DD01V_WA
          TABLES
            DD07V_TAB         DD07V_TAB
          EXCEPTIONS
            DOMA_NOT_FOUND    1
            NAME_INCONSISTENT 2
            DOMA_INCONSISTENT 3
            PUT_FAILURE       4
            PUT_REFUSED       5
            OTHERS            6.
        IF SY-SUBRC 0.

          CALL FUNCTION 'DDIF_DOMA_ACTIVATE'
            EXPORTING
              NAME              DD03P_TAB-DOMNAME
*     AUTH_CHK          = 'X'
*     PRID              = -1
*   IMPORTING
*     RC                =
           EXCEPTIONS
             NOT_FOUND         1
             PUT_FAILURE       2
             OTHERS            3
                    .
          IF SY-SUBRC <> 0.
* Implement suitable error handling here
          ENDIF.

        ENDIF.

        IF GV_REQ_NO IS INITIAL.
          PERFORM CREATE_REQUEST.
        ENDIF.

        PERFORM ASSIGN_OBJ_DOM.

      ENDIF.


    ENDIF.

  ENDLOOP.

ENDFORM.                    " CHECK_DOMAIN
*&---------------------------------------------------------------------*
*&      Form  CHECK_DELE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM CHECK_DELE .

  LOOP AT DD03P_TAB.

    IF DD03P_TAB-ROLLNAME+0(1'Z' OR DD03P_TAB-ROLLNAME+0(1'Y'.

      CALL FUNCTION 'DDIF_DTEL_GET'
        EXPORTING
          NAME          DD03P_TAB-ROLLNAME
          STATE         'A'
          LANGU         SY-LANGU
        IMPORTING
*         GOTSTATE      =
          DD04V_WA      DD04V_WA
*         TPARA_WA      =
        EXCEPTIONS
          ILLEGAL_INPUT 1
          OTHERS        2.


      IF DD04V_WA IS INITIAL.

        MOVE-CORRESPONDING DD03P_TAB TO DD04V_WA.


        CALL FUNCTION 'DDIF_DTEL_PUT'
          EXPORTING
            NAME              DD03P_TAB-ROLLNAME
            DD04V_WA          DD04V_WA
          EXCEPTIONS
            DTEL_NOT_FOUND    1
            NAME_INCONSISTENT 2
            DTEL_INCONSISTENT 3
            PUT_FAILURE       4
            PUT_REFUSED       5
            OTHERS            6.
        IF SY-SUBRC 0.
          CALL FUNCTION 'DDIF_DTEL_ACTIVATE'
            EXPORTING
              NAME              DD03P_TAB-ROLLNAME
*     AUTH_CHK          = 'X'
*     PRID              = -1
*   IMPORTING
*     RC                =
           EXCEPTIONS
             NOT_FOUND         1
             PUT_FAILURE       2
             OTHERS            3
                    .
          IF SY-SUBRC <> 0.
* Implement suitable error handling here
          ENDIF.


        ENDIF.


        IF GV_REQ_NO IS INITIAL.
          PERFORM CREATE_REQUEST.
        ENDIF.

        PERFORM ASSIGN_OBJ_DELM.


      ENDIF.

    ENDIF.


  ENDLOOP.

ENDFORM.                    " CHECK_DELE
*&---------------------------------------------------------------------*
*&      Form  CREATE_TABLE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM CREATE_TABLE .

  CLEAR TABLE_HEADER,TECHN_SET,LT_FIELDS.
  REFRESH LT_FIELDS.

  IF R_TABLE 'X'.

    TABLE_HEADER-TABNAME P_TAB.
    TABLE_HEADER-DDTEXT 'New Table'.
    TABLE_HEADER-DDLANGUAGE SY-LANGU.
    TABLE_HEADER-TABCLASS 'TRANSP'.
    TABLE_HEADER-AS4USER SY-UNAME.
    TABLE_HEADER-CONTFLAG 'A'.
    TABLE_HEADER-MAINFLAG 'X'.
    TABLE_HEADER-EXCLASS   3.


    TECHN_SET-TABNAME P_TAB.
    TECHN_SET-TABKAT 2.
    TECHN_SET-TABART 'APPL1'.
    TECHN_SET-BUFALLOW 'N'.

  ELSEIF R_STRUCT 'X' .

    TABLE_HEADER-TABNAME P_TAB.
    TABLE_HEADER-DDTEXT 'New Structure'.
    TABLE_HEADER-DDLANGUAGE SY-LANGU.
    TABLE_HEADER-TABCLASS 'INTTAB'.
    TABLE_HEADER-AS4USER SY-UNAME.
    TABLE_HEADER-VIEWCLASS 'D'.
    TABLE_HEADER-VIEWGRANT 'R'.
    TABLE_HEADER-EXCLASS   3.

*  ELSEIF APP_STR = 'X'.
*    TABLE_HEADER-TABNAME = P_TAB.
*    TABLE_HEADER-DDTEXT = 'Append Structure'.
*    TABLE_HEADER-DDLANGUAGE = SY-LANGU.
*    TABLE_HEADER-TABCLASS = 'APPEND'.
*    TABLE_HEADER-AS4USER = SY-UNAME.

  ENDIF.


  LOOP AT DD03P_TAB.

    WA_FIELD DD03P_TAB.
    WA_FIELD-TABNAME P_TAB.

    APPEND WA_FIELD TO LT_FIELDS.
    CLEAR WA_FIELD.

  ENDLOOP.

  L_NAME P_TAB.

  CALL FUNCTION 'DDIF_TABL_PUT'
    EXPORTING
      NAME              L_NAME
      DD02V_WA          TABLE_HEADER
      DD09L_WA          TECHN_SET
    TABLES
      DD03P_TAB         LT_FIELDS " Table fields
    EXCEPTIONS
      TABL_NOT_FOUND    1
      NAME_INCONSISTENT 2
      TABL_INCONSISTENT 3
      PUT_FAILURE       4
      PUT_REFUSED       5
      OTHERS            6.

  IF SY-SUBRC 0.

    WRITE/'Table Created'.

  ELSE.

    WRITE/'Error occurred'.

  ENDIF.


*Activating the Table


  L_NAME P_TAB.

  CALL FUNCTION 'DDIF_TABL_ACTIVATE'

     EXPORTING

       NAME              L_NAME

* IMPORTING

*   RC                =

  EXCEPTIONS

      NOT_FOUND         1

      PUT_FAILURE       2

      OTHERS            3.

  IF SY-SUBRC <> 0.

    WRITE/'Table could not be activated.'.

    RETURN.

  ELSE.

    WRITE/'Table has been activated.'.


    IF GV_REQ_NO IS INITIAL.
      PERFORM CREATE_REQUEST.
    ENDIF.

    PERFORM ASSIGN_OBJ_TAB.

    CONCATENATE W_REQDESC '--' GV_REQ_NO INTO W_REQDESC.


    WRITE / W_REQDESC.

  ENDIF.



ENDFORM.                    " CREATE_TABLE
*&---------------------------------------------------------------------*
*&      Form  GET_FILE2
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_FILE_DOM  text
*----------------------------------------------------------------------*
FORM GET_FILE2  USING    P_FILE_DOM.

  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    CHANGING
      FILE_NAME FILE_DOM.

ENDFORM.                    " GET_FILE2
*&---------------------------------------------------------------------*
*&      Form  UPLOAD2
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_FILE_DOM  text
*----------------------------------------------------------------------*
FORM UPLOAD2  USING    P_FILE_DOM.

  CLEAR IT_UPLOADIT_UPLOAD[].

  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                P_FILE_DOM
      I_BEGIN_COL             1
      I_BEGIN_ROW             2
      I_END_COL               10
      I_END_ROW               9999
    TABLES
      INTERN                  IT_UPLOAD
    EXCEPTIONS
      INCONSISTENT_PARAMETERS 1
      UPLOAD_OLE              2
      OTHERS                  3.



*  IF IT_UPLOAD[] IS INITIAL.
*    MESSAGE 'No data Uploaded' TYPE 'I'.
*  ENDIF.

  LOOP AT IT_UPLOAD INTO WA_UPLOAD.
    CASE WA_UPLOAD-COL.
      WHEN '0001'.
        WA_DD07V-DOMNAME WA_UPLOAD-VALUE.

      WHEN '0002'.
        WA_DD07V-VALPOS WA_UPLOAD-VALUE.

      WHEN '0003'.
        WA_DD07V-DDLANGUAGE WA_UPLOAD-VALUE.

      WHEN '0004'.
        WA_DD07V-DOMVALUE_L WA_UPLOAD-VALUE.

      WHEN '0005'.
        WA_DD07V-DOMVALUE_H WA_UPLOAD-VALUE.

      WHEN '0006'.
        WA_DD07V-DDTEXT WA_UPLOAD-VALUE.

      WHEN '0007'.
        WA_DD07V-DOMVAL_LD WA_UPLOAD-VALUE.

      WHEN '0008'.
        WA_DD07V-DOMVAL_HD WA_UPLOAD-VALUE.

      WHEN '0009'.
        WA_DD07V-APPVAL WA_UPLOAD-VALUE.

    ENDCASE.

    AT  END OF ROW.
      APPEND  WA_DD07V TO DD07V_TAB_DOWN.
      CLEAR WA_DD07V.
    ENDAT.
  ENDLOOP.

ENDFORM.                    " UPLOAD2
*&---------------------------------------------------------------------*
*&      Form  CREATE_REQUEST
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM CREATE_REQUEST .


  CONCATENATE 'Request no for Table ' P_TAB INTO W_REQDESC.

  CALL FUNCTION 'IW_C_CREATE_TRANSPORT_REQUEST'
    EXPORTING
      DESCRIPTION            W_REQDESC
      TRANSPORT_KIND         'K'
      LANGU                  SY-LANGU
    IMPORTING
      COMMFILE               GV_REQ_NO
    EXCEPTIONS
      LANGUAGE_MISSING       1
      NUMBER_RANGE_FULL      2
      UNALLOWED_TRFUNCTION   3
      NO_AUTHORIZATION       4
      CREATE_TRANSPORT_ERROR 5
      OTHERS                 6.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  GS_AUTHORLIST-TASK_OWNER SY-UNAME.
  APPEND GS_AUTHORLIST TO GT_AUTHORLIST.

  GS_AUTHORLIST-TASK_OWNER SY-UNAME.
  APPEND GS_AUTHORLIST TO GT_AUTHORLIST.

  CALL FUNCTION 'BAPI_CTREQUEST_CREATE_TASKS'
    EXPORTING
      REQUESTID        GV_REQ_NO
* IMPORTING
*   RETURN           =
    TABLES
      AUTHORLIST       GT_AUTHORLIST
      TASK_LIST        GT_TASK_LIST
            .

ENDFORM.                    " CREATE_REQUEST
*&---------------------------------------------------------------------*
*&      Form  ASSIGN_OBJ
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM ASSIGN_OBJ_DOM.

  CLEAR BDCDATA.
  REFRESH BDCDATA.

  PERFORM BDC_DYNPRO      USING 'SAPLSD_ENTRY' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'RSRD1-DOMA'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=CHANGE_RADIO'.
  PERFORM BDC_FIELD       USING 'RSRD1-DDTYPE'
                                ''.
  PERFORM BDC_FIELD       USING 'RSRD1-DDTYPE_VAL'
                                ''.
  PERFORM BDC_FIELD       USING 'RSRD1-DOMA'
                                'X'.
  PERFORM BDC_FIELD       USING 'RSRD1-DOMA_VAL'
                                DD03P_TAB-DOMNAME.


  PERFORM BDC_DYNPRO      USING 'SAPLSD_ENTRY' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'RSRD1-DOMA_VAL'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_EDIT'.
  PERFORM BDC_FIELD       USING 'RSRD1-DOMA'
                                'X'.
  PERFORM BDC_FIELD       USING 'RSRD1-DOMA_VAL'
                                DD03P_TAB-DOMNAME.


  PERFORM BDC_DYNPRO      USING 'SAPLSD11' '1200'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'DD01D-DDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_TADIR_EDIT'.

*perform bdc_field       using 'DD01D-DDTEXT'
*                              'Deletion Flag'.
*perform bdc_field       using 'DD01D-DATATYPE'
*                              'CHAR'.
*perform bdc_field       using 'DD01D-LENG'
*                              '     1'.
*perform bdc_field       using 'DD01D-OUTPUTLEN'
*                              '     1'.


  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0100'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO007-L_DEVCLASS'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=ADD'.
  PERFORM BDC_FIELD       USING 'KO007-L_DEVCLASS'
                                W_PACKAGE.
  PERFORM BDC_FIELD       USING 'KO007-L_AUTHOR'
                                SY-UNAME.


  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0300'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO008-TRKORR'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=LOCK'.
  PERFORM BDC_FIELD       USING 'KO008-TRKORR'
                                GV_REQ_NO.


  PERFORM BDC_DYNPRO      USING 'SAPLSD11' '1200'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'DD01D-DDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_SAVE'.

  CONCATENATE DD03P_TAB-DDTEXT '.' INTO DD03P_TAB-DDTEXT.

  PERFORM BDC_FIELD       USING 'DD01D-DDTEXT'
                                DD03P_TAB-DDTEXT.
*perform bdc_field       using 'DD01D-DATATYPE'
*                              'CHAR'.
*perform bdc_field       using 'DD01D-LENG'
*                              '     1'.
*perform bdc_field       using 'DD01D-OUTPUTLEN'
*                              '     1'.


  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0300'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO008-TRKORR'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=LOCK'.
  PERFORM BDC_FIELD       USING 'KO008-TRKORR'
                                GV_REQ_NO.


  PERFORM BDC_DYNPRO      USING 'SAPLSD11' '1200'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'DD01D-DDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_ACTIVATE'.
*perform bdc_field       using 'DD01D-DDTEXT'
*                              'Deletion Flag'.
*perform bdc_field       using 'DD01D-DATATYPE'
*                              'CHAR'.
*perform bdc_field       using 'DD01D-LENG'
*                              '     1'.
*perform bdc_field       using 'DD01D-OUTPUTLEN'
*                              '     1'.


  PERFORM BDC_DYNPRO      USING 'SAPLSEWORKINGAREA' '0205'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WEIT'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'WORK_ITEMS-OBJ_NAME(01)'.


  WA_OPTIONS-DISMODE  'N'.


  REFRESH:IT_MESSTAB.

  CALL TRANSACTION 'SE11' USING BDCDATA OPTIONS FROM WA_OPTIONS
           MESSAGES INTO IT_MESSTAB.

  COMMIT WORK.

ENDFORM.                    " ASSIGN_OBJ

*&---------------------------------------------------------------------*
*&      Form  BDC_DYNPRO
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_0308   text
*      -->P_0309   text
*----------------------------------------------------------------------*
FORM BDC_DYNPRO  USING     PROGRAM DYNPRO.

  CLEAR BDCDATA.
  BDCDATA-PROGRAM  PROGRAM.
  BDCDATA-DYNPRO   DYNPRO.
  BDCDATA-DYNBEGIN 'X'.
  APPEND BDCDATA.


ENDFORM.                    " BDC_DYNPRO
*&---------------------------------------------------------------------*
*&      Form  BDC_FIELD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_0313   text
*      -->P_0314   text
*----------------------------------------------------------------------*
FORM BDC_FIELD  USING    FNAM FVAL .

  CLEAR BDCDATA.
  BDCDATA-FNAM FNAM.
  BDCDATA-FVAL FVAL.
  APPEND BDCDATA.


ENDFORM.                    " BDC_FIELD    .
*&---------------------------------------------------------------------*
*&      Form  ASSIGN_OBJ_DELM
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM ASSIGN_OBJ_DELM .

  CLEAR BDCDATA.
  REFRESH BDCDATA.



  PERFORM BDC_DYNPRO      USING 'SAPLSD_ENTRY' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'RSRD1-DOMA_VAL'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_EDIT'.
  PERFORM BDC_FIELD       USING 'RSRD1-TBMA_VAL'
                                ''.
  PERFORM BDC_FIELD       USING 'RSRD1-VIMA_VAL'
                                ''.
  PERFORM BDC_FIELD       USING 'RSRD1-DDTYPE'
                                'X'.
  PERFORM BDC_FIELD       USING 'RSRD1-DDTYPE_VAL'
                                DD03P_TAB-ROLLNAME.
  PERFORM BDC_FIELD       USING 'RSRD1-DOMA_VAL'
                                ''.


  PERFORM BDC_DYNPRO      USING 'SAPLSD51' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_TADIR_EDIT'.
*  PERFORM BDC_FIELD       USING 'DD04D-DDTEXT'
*                                'Deletion Flag'.
*  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
*                                'DD04D-DOMNAME'.
*  PERFORM BDC_FIELD       USING 'RADIO-ELEM'
*                                'X'.
*  PERFORM BDC_FIELD       USING 'RADIO-DOMAIN'
*                                'X'.
*  PERFORM BDC_FIELD       USING 'DD04D-DOMNAME'
*                                'ZDFLGP_222'.


  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0100'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO007-L_DEVCLASS'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=ADD'.
  PERFORM BDC_FIELD       USING 'KO007-L_DEVCLASS'
                                W_PACKAGE.
  PERFORM BDC_FIELD       USING 'KO007-L_AUTHOR'
                                SY-UNAME.


  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0300'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO008-TRKORR'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=LOCK'.
  PERFORM BDC_FIELD       USING 'KO008-TRKORR'
                                GV_REQ_NO.


  PERFORM BDC_DYNPRO      USING 'SAPLSD51' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'DD04D-DDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_SAVE'.

  CONCATENATE DD03P_TAB-DDTEXT '.' INTO DD03P_TAB-DDTEXT.
  PERFORM BDC_FIELD       USING 'DD04D-DDTEXT'
                                DD03P_TAB-DDTEXT.

*  PERFORM BDC_FIELD       USING 'RADIO-ELEM'
*                                'X'.
*  PERFORM BDC_FIELD       USING 'RADIO-DOMAIN'
*                                'X'.
*  PERFORM BDC_FIELD       USING 'DD04D-DOMNAME'
*                                'ZDFLGP_222'.


  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0300'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO008-TRKORR'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=LOCK'.
  PERFORM BDC_FIELD       USING 'KO008-TRKORR'
                                GV_REQ_NO.


  PERFORM BDC_DYNPRO      USING 'SAPLSD51' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'DD04D-DDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_ACTIVATE'.
*  PERFORM BDC_FIELD       USING 'DD04D-DDTEXT'
*                                'Deletion Flag'.
*  PERFORM BDC_FIELD       USING 'RADIO-ELEM'
*                                'X'.
*  PERFORM BDC_FIELD       USING 'RADIO-DOMAIN'
*                                'X'.
*  PERFORM BDC_FIELD       USING 'DD04D-DOMNAME'
*                                'ZDFLGP_222'.

  PERFORM BDC_DYNPRO      USING 'SAPLSEWORKINGAREA' '0205'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WEIT'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'WORK_ITEMS-OBJ_NAME(01)'.


  WA_OPTIONS-DISMODE  'N'.


  REFRESH:IT_MESSTAB.

  CALL TRANSACTION 'SE11' USING BDCDATA OPTIONS FROM WA_OPTIONS
           MESSAGES INTO IT_MESSTAB.
  COMMIT WORK.

ENDFORM.                    " ASSIGN_OBJ_DELM
*&---------------------------------------------------------------------*
*&      Form  ASSIGN_OBJ_TAB
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM ASSIGN_OBJ_TAB .

  CLEAR BDCDATA.
  REFRESH BDCDATA.

  PERFORM BDC_DYNPRO      USING 'SAPLSD_ENTRY' '1000'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'RSRD1-TBMA_VAL'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_EDIT'.
  PERFORM BDC_FIELD       USING 'RSRD1-TBMA'
                                'X'.
  PERFORM BDC_FIELD       USING 'RSRD1-TBMA_VAL'
                                L_NAME.
*  PERFORM BDC_FIELD       USING 'RSRD1-DDTYPE_VAL'
*                                'ZZPROD_FORM'.
*  PERFORM BDC_FIELD       USING 'RSRD1-DOMA_VAL'
*                                'ZDFLGP_223'.

  PERFORM BDC_DYNPRO      USING 'SAPLSD41' '2200'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'DD02D-DDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_TADIR_EDIT'.
*  PERFORM BDC_FIELD       USING 'DD02D-DDTEXT'
*                                'New Table'.

  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0100'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO007-L_DEVCLASS'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=ADD'.
  PERFORM BDC_FIELD       USING 'KO007-L_DEVCLASS'
                                W_PACKAGE.
  PERFORM BDC_FIELD       USING 'KO007-L_AUTHOR'
                                SY-UNAME.

  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0300'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO008-TRKORR'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=LOCK'.
  PERFORM BDC_FIELD       USING 'KO008-TRKORR'
                                GV_REQ_NO.

  PERFORM BDC_DYNPRO      USING 'SAPLSD41' '2200'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'DD02D-DDTEXT'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WB_ACTIVATE'.

  PERFORM BDC_FIELD       USING 'DD02D-DDTEXT'
                                'New Table.'.


  PERFORM BDC_DYNPRO      USING 'SAPLSTRD' '0300'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'KO008-TRKORR'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=LOCK'.
  PERFORM BDC_FIELD       USING 'KO008-TRKORR'
                                GV_REQ_NO.

  PERFORM BDC_DYNPRO      USING 'SAPLSEWORKINGAREA' '0205'.
  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                '=WEIT'.
  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'WORK_ITEMS-OBJ_NAME(01)'.

  WA_OPTIONS-DISMODE  'N'.


  REFRESH:IT_MESSTAB.

  CALL TRANSACTION 'SE11' USING BDCDATA OPTIONS FROM WA_OPTIONS
           MESSAGES INTO IT_MESSTAB.

  COMMIT WORK.

ENDFORM.                    " ASSIGN_OBJ_TAB

 

  • No labels