Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

manual bdc program

Former Member
0 Kudos

hai everybody ..

can any one send me a sample of manual bdc program pls..

Regards,

pandu.

4 REPLIES 4

rainer_hbenthal
Active Contributor
0 Kudos

Goto sm35, select a recording and generate one by yourself.

Former Member
0 Kudos

Hi Pandurangarao,

Check this Sample program.

REPORT ZASSET .

INCLUDE ZASSET_INC .

PARAMETERS: P_PCFILE LIKE RLGRAP-FILENAME.

*PARAMETERS: P_FILE_S LIKE RLGRAP-FILENAME.

PARAMETER : H_CHK AS CHECKBOX.

"Proc Mode

----


  • Include the BDC *

----


************************************************************************

**

**BDC DATA STUCTURE

************************************************************************

**

*DATA: BEGIN OF BDCDATA OCCURS 0.

  • INCLUDE STRUCTURE BDCDATA.

*DATA: END OF BDCDATA.

************************************************************************

**

    • messages of call transaction

************************************************************************

**

*DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

*

************************************************************************

  • TYPE-POOLS

************************************************************************

TYPE-POOLS TRUXS.

DATA IT_DATA1 TYPE TRUXS_T_TEXT_DATA.

DATA : BEGIN OF IT_DATA OCCURS 0,

INVZU(015),

ANLKL(008),

BUKRS(004),

TXT50(100),

SERNR(018),

MENGE(018),

  • INKEN(001),

AKTIV(010),

KOSTL(010),

WERKS(004),

STORT(010),

ORD41(004),

ORD42(004),

  • EQANZ(001),

LIFNR(010),

  • AFASL(004),

  • NDJAR(003),

  • AFABG(010),

ANLGR(012),

ANLGR2(004),

ANBTR01_01(016),

ANBTR01_06(016),

ANBTR01_16(016),

TDATE(010),

TCODE(004),

TAMT(018),

PERNR(012),

KFZKF(015),

SAP_ASSET(12),

ERR_ASSET,

END OF IT_DATA.

DATA : BEGIN OF IT_DATA2 OCCURS 0,

INVZU(015),

TDATE(010),

TCODE(004),

TAMT(018),

END OF IT_DATA2.

DATA : BEGIN OF IT_DATA3 OCCURS 0,

ITEM(003),

INVZU(015),

ANLKL(010),

BUKRS(010),

TXT50(050),

SERNR(018),

MENGE(018),

  • INKEN(001),

AKTIV(010),

KOSTL(010),

WERKS(004),

STORT(010),

ORD41(004),

ORD42(004),

  • EQANZ(001),

LIFNR(010),

  • AFASL(004),

  • NDJAR(003),

  • AFABG(010),

ANLGR(012),

ANLGR2(004),

ANBTR01_01(016),

ANBTR01_06(016),

ANBTR01_16(016),

TDATE(010),

TCODE(004),

TAMT(018),

SAP_ASSET(12),

ERR_ASSET,

END OF IT_DATA3.

*----


  • SUB ASSET MASTER TABLE

*----


DATA : BEGIN OF IT_DATA_SUB OCCURS 0,

INVZU_M(015),

INVZU(015),

BUKRS(004),

TXT50(100),

  • ANLHTXT(050),

SERNR(018),

MENGE(018),

  • MEINS_007(003),

  • XHIST_008(001),

AKTIV(010),

  • GSBER_011(004),

KOSTL(010),

STORT(010),

ORD41(004),

ORD42(004),

  • EQANZ_016(001),

LIFNR(010),

  • LIEFE(030),

NDJAR(003),

NDPER(003),

ANBTR01_01(016),

ANBTR01_06(016),

ANBTR01_16(016),

BZDAT(010),

BWASL(003),

ANBTR01(016),

ANLN1(012),

ERR_SUB,

SUB_CODE(012),

ERR_SUB1,

END OF IT_DATA_SUB.

&----


*& At selection-screen on value request for getting f4 help

&----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PCFILE.

PERFORM VALUE_REQUEST_P_FILE.

*AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_S.

*

  • PERFORM VALUE_REQUEST_P_FILE_S.

----


  • START OF SELECTION *

----


START-OF-SELECTION.

----


  • To Upload the flat file datas *

----


PERFORM GET_DATA.

PERFORM UP_LOAD.

  • PERFORM SUB_UPLOAD.

*

  • WRITE 😕 'FOLLOWING ASSETS CREATED'.

  • WRITE:/ 'OLD ASSET'.

  • WRITE: 20 'COMPANY'.

  • WRITE: 30 'SAP CODE'.

*

  • LOOP AT IT_DATA WHERE ERR_ASSET NE 'X'.

  • WRITE 😕 IT_DATA-INVZU,

  • 20 IT_DATA-BUKRS, 30 IT_DATA-SAP_ASSET.

  • ENDLOOP.

  • SKIP 2.

  • WRITE 😕 'FOLLOWING SUB ASSETS CREATED'.

  • WRITE:/ 'OLD ASSET'.

  • WRITE: 16 'OLD SUB ASSET'.

  • WRITE: 35 'COMPANY'.

  • WRITE: 45 'SAP CODE'.

  • WRITE: 60 'SUB ASSET'.

*

  • LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X' AND ERR_SUB1 NE 'X'.

  • WRITE 😕 IT_DATA_SUB-INVZU_M,

  • 16 IT_DATA_SUB-INVZU,

  • 35 IT_DATA_SUB-BUKRS, 45 IT_DATA_SUB-ANLN1, 60

*IT_DATA_SUB-SUB_CODE.

  • ENDLOOP.

&----


*& Form value_request_p_file

&----


FORM VALUE_REQUEST_P_FILE .

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = 'x'

IMPORTING

FILE_NAME = P_PCFILE.

ENDFORM. " value_request_p_file

&----


*& Form UP_LOAD

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM UP_LOAD .

SORT IT_DATA BY INVZU.

SORT IT_DATA2 BY INVZU.

DATA : V_LEN1 TYPE I, V_LEN2 TYPE I, V_SUBSTR1(50) ,V_SUBSTR2(50).

  • perform open_dataset using dataset.

PERFORM OPEN_GROUP.

LOOP AT IT_DATA.

CONDENSE IT_DATA-TXT50.

V_LEN1 = STRLEN( IT_DATA-TXT50 ).

IF V_LEN1 > 50.

V_SUBSTR1 = IT_DATA-TXT50+0(50).

V_LEN2 = V_LEN1 - 50.

V_SUBSTR2 = IT_DATA-TXT50+50(50).

ELSE.

V_SUBSTR1 = IT_DATA-TXT50.

V_SUBSTR2 = ''..

ENDIF.

REFRESH BDCDATA.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '0105'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ANLA-BUKRS'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'/00'.

PERFORM BDC_FIELD USING 'ANLA-ANLKL'

IT_DATA-ANLKL.

PERFORM BDC_FIELD USING 'ANLA-BUKRS'

IT_DATA-BUKRS.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=TAB02'.

PERFORM BDC_FIELD USING 'ANLA-TXT50'

V_SUBSTR1. "IT_DATA-TXT50.

PERFORM BDC_FIELD USING 'ANLA-TXA50'

V_SUBSTR2.

PERFORM BDC_FIELD USING 'ANLA-SERNR'

IT_DATA-SERNR.

PERFORM BDC_FIELD USING 'ANLA-MENGE'

IT_DATA-MENGE.

*perform bdc_field using 'ANLA-INKEN'

  • record-INKEN_006.

PERFORM BDC_FIELD USING 'ANLA-INVZU'

IT_DATA-INVZU.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ANLA-AKTIV'.

PERFORM BDC_FIELD USING 'ANLA-AKTIV'

IT_DATA-AKTIV.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=TAB03'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ANLZ-PERNR'.

PERFORM BDC_FIELD USING 'ANLZ-PERNR'

IT_DATA-PERNR.

PERFORM BDC_FIELD USING 'ANLZ-KOSTL'

IT_DATA-KOSTL.

PERFORM BDC_FIELD USING 'ANLZ-WERKS'

IT_DATA-WERKS.

PERFORM BDC_FIELD USING 'ANLZ-STORT'

IT_DATA-STORT.

IF IT_DATA-ANLKL = 'VHCL'.

PERFORM BDC_FIELD USING 'ANLZ-KFZKZ'

IT_DATA-KFZKF.

ENDIF.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=TAB04'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ANLA-ORD42'.

PERFORM BDC_FIELD USING 'ANLA-ORD41'

IT_DATA-ORD41.

PERFORM BDC_FIELD USING 'ANLA-ORD42'

IT_DATA-ORD42.

*perform bdc_field using 'RA02S-EQANZ'

  • record-EQANZ_014.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=TAB06'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ANLA-LIFNR'.

PERFORM BDC_FIELD USING 'ANLA-LIFNR'

IT_DATA-LIFNR.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=TAB08'.

  • PERFORM BDC_FIELD USING 'BDC_CURSOR'

  • 'ANLV-VSART'.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SELZ'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RA02S-XAKPLA(02)'.

PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ANLB-AFASL'.

  • IF IT_DATA-TCODE IS INITIAL.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ALTD'.

  • ELSE.

  • PERFORM BDC_FIELD USING 'BDC_OKCODE'

  • '=ALTB'.

*

  • ENDIF.

PERFORM BDC_FIELD USING 'ANLB-ANLGR'

IT_DATA-ANLGR.

PERFORM BDC_FIELD USING 'ANLB-ANLGR2'

IT_DATA-ANLGR2.

PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.

IF IT_DATA-TCODE IS INITIAL.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=BUCH'.

PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'

IT_DATA-ANBTR01_01.

IF H_CHK NE 'X'.

PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'

IT_DATA-ANBTR01_06.

ENDIF.

ELSE.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=ALTB'.

PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=BUCH'.

PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'

IT_DATA-TDATE.

PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'

IT_DATA-TCODE.

PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'

IT_DATA-TAMT.

ENDIF.

  • REFRESH MESSTAB.

  • CALL TRANSACTION 'AS91' USING BDCDATA

  • MODE H_MODE

  • UPDATE 'S'

  • MESSAGES INTO MESSTAB.

PERFORM BDC_TRANSACTION USING 'AS91'.

ENDLOOP..

PERFORM CLOSE_GROUP.

*perform close_dataset using dataset.

ENDFORM. " UP_LOAD

&----


*& Form GET_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_DATA .

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

I_TAB_RAW_DATA = IT_DATA1

I_FILENAME = P_PCFILE

TABLES

I_TAB_CONVERTED_DATA = IT_DATA.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • LOOP AT IT_DATA3.

  • IF IT_DATA3-ITEM = '1'.

  • MOVE-CORRESPONDING IT_DATA3 TO IT_DATA.

  • APPEND IT_DATA.

  • ELSEIF IT_DATA3-ITEM = '2'.

  • IT_DATA2-INVZU = IT_DATA3-INVZU.

  • IT_DATA2-TDATE = IT_DATA3-ANLKL.

  • IT_DATA2-TCODE = IT_DATA3-BUKRS.

  • IT_DATA2-TAMT = IT_DATA3-TXT50.

  • APPEND IT_DATA2.

*

  • ENDIF.

  • ENDLOOP.

  • IF NOT P_FILE_S IS INITIAL.

*

  • CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

  • EXPORTING

  • I_TAB_RAW_DATA = IT_DATA1

  • I_FILENAME = P_FILE_S

  • TABLES

  • I_TAB_CONVERTED_DATA = IT_DATA_SUB.

  • 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.

ENDFORM. " GET_DATA

***----


**

      • FORM BDC_DYNPRO

**

***----


**

      • ........

**

***----


**

      • --> PROGRAM

**

      • --> DYNPRO

**

***----


**

**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

**

***----


**

      • ........

**

***----


**

      • --> FNAM

**

      • --> FVAL

**

***----


**

**FORM BDC_FIELD USING FNAM FVAL.

    • CLEAR BDCDATA.

    • BDCDATA-FNAM = FNAM.

    • BDCDATA-FVAL = FVAL.

    • APPEND BDCDATA.

**ENDFORM. "BDC_FIELD

***&----


*-

***

***& Form bdc_transaction

***&----


*-

***

      • text

***----


*-

***

      • -->TCODE text

***----


*-

***

**FORM BDC_TRANSACTION USING TCODE.

    • REFRESH MESSTAB.

    • CALL TRANSACTION TCODE USING BDCDATA

    • MODE H_MODE

    • UPDATE 'S'

    • MESSAGES INTO MESSTAB.

**ENDFORM. " bdc_transaction

&----


*& Form VALUE_REQUEST_P_FILE_S

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM VALUE_REQUEST_P_FILE_S .

  • CALL FUNCTION 'F4_FILENAME'

  • EXPORTING

  • PROGRAM_NAME = SYST-CPROG

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = 'x'

  • IMPORTING

  • FILE_NAME = P_FILE_S.

*

ENDFORM. " VALUE_REQUEST_P_FILE_S

&----


*& Form sUB_upload

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


***FORM SUB_UPLOAD .

      • DATA : V_LEN1 TYPE I, V_LEN2 TYPE I, V_SUBSTR1(50) ,V_SUBSTR2(50).

***

      • LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X'.

      • CONDENSE IT_DATA_SUB-TXT50.

***

      • V_LEN1 = STRLEN( IT_DATA_SUB-TXT50 ).

      • IF V_LEN1 > 50.

      • V_SUBSTR1 = IT_DATA_SUB-TXT50+0(50).

      • V_LEN2 = V_LEN1 - 50.

      • V_SUBSTR2 = IT_DATA_SUB-TXT50+50(50).

      • ELSE.

      • V_SUBSTR1 = IT_DATA_SUB-TXT50.

      • V_SUBSTR2 = ''..

***

      • ENDIF.

      • REFRESH BDCDATA.

***

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '0110'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-ANLN1'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=MAST'.

      • PERFORM BDC_FIELD USING 'ANLA-ANLN1'

      • IT_DATA_SUB-ANLN1.

      • PERFORM BDC_FIELD USING 'ANLA-BUKRS'

      • IT_DATA_SUB-BUKRS.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB02'.

      • PERFORM BDC_FIELD USING 'ANLA-TXT50'

      • V_SUBSTR1. "IT_DATA_SUB-TXT50.

***

      • PERFORM BDC_FIELD USING 'ANLA-TXa50'

      • V_SUBSTR2. "IT_DATA_SUB-TXT50.

****perform bdc_field using 'ANLH-ANLHTXT'

        • it_data_sub-ANLHTXT_004.

      • PERFORM BDC_FIELD USING 'ANLA-SERNR'

      • IT_DATA_SUB-SERNR.

      • PERFORM BDC_FIELD USING 'ANLA-MENGE'

      • IT_DATA_SUB-MENGE.

****perform bdc_field using 'ANLA-MEINS'

        • it_data_sub-MEINS_007.

****perform bdc_field using 'RA02S-XHIST'

        • it_data_sub-XHIST_008.

      • PERFORM BDC_FIELD USING 'ANLA-INVZU'

      • IT_DATA_SUB-INVZU.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-AKTIV'.

      • PERFORM BDC_FIELD USING 'ANLA-AKTIV'

      • IT_DATA_SUB-AKTIV.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB03'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLZ-GSBER'.

****perform bdc_field using 'ANLZ-GSBER'

        • it_data_sub-GSBER_011.

****perform bdc_field using 'ANLZ-KOSTL'

        • it_data_sub-KOSTL_012.

      • PERFORM BDC_FIELD USING 'ANLZ-STORT'

      • IT_DATA_SUB-STORT.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB04'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-ORD41'.

      • PERFORM BDC_FIELD USING 'ANLA-ORD41'

      • IT_DATA_SUB-ORD41.

      • PERFORM BDC_FIELD USING 'ANLA-ORD42'

      • IT_DATA_SUB-ORD42.

****perform bdc_field using 'RA02S-EQANZ'

        • it_data_sub-EQANZ_016.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB07'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-LIFNR'.

      • PERFORM BDC_FIELD USING 'ANLA-LIFNR'

      • IT_DATA_SUB-LIFNR.

****perform bdc_field using 'ANLA-LIEFE'

        • IT_DATA_SUB-LIEFE.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB08'.

***

***

******************************************

        • PERFORM BDC_FIELD USING 'BDC_CURSOR'

        • 'ANLA-LEART'.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=SELZ'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'T093T-AFBKTX(01)'.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLB-NDPER'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=ALTD'.

      • PERFORM BDC_FIELD USING 'ANLB-NDJAR'

      • IT_DATA_SUB-NDJAR.

      • PERFORM BDC_FIELD USING 'ANLB-NDPER'

      • IT_DATA_SUB-NDPER.

****perform bdc_field using 'ANLB-AFABG'

        • record-AFABG_029.

      • PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.

        • PERFORM BDC_FIELD USING 'BDC_CURSOR'

        • 'ANLA-ANLN1'.

***

      • IF IT_DATA_SUB-BWASL IS INITIAL.

***

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=BUCH'.

***

******************************************

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'

      • IT_DATA_SUB-ANBTR01_01.

        • Accu deprn automatically calculated by system changed on 6th Aug.

        • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'

        • IT_DATA_SUB-ANBTR01_06.

***

***

********************************************

      • ELSE.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=ALTB'.

***

***

***

      • PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '/00'.

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'

      • IT_DATA_SUB-BZDAT.

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'

      • IT_DATA_SUB-BWASL.

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'

      • IT_DATA_SUB-ANBTR01.

      • PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-ANLN1'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=BUCH'.

****perform bdc_transaction using 'AS94'.

      • ENDIF.

***

      • REFRESH MESSTAB.

      • CALL TRANSACTION 'AS94' USING BDCDATA

      • MODE H_MODE

      • UPDATE 'S'

      • MESSAGES INTO MESSTAB.

      • IF SY-SUBRC = 0.

        • READ TABLE MESSTAB INDEX 1.

        • IT_DATA_sub-SUB_CODE = MESSTAB-MSGV1.

      • DATA AN1 TYPE ANLN1.

      • DATA AN2 TYPE ANLN2.

      • GET PARAMETER ID 'AN2' FIELD AN2.

      • IT_DATA_SUB-SUB_CODE = AN2. "MESSTAB-MSGV1.

***

      • MODIFY IT_DATA_SUB TRANSPORTING SUB_CODE.

      • ELSE.

      • IT_DATA_SUB-ERR_SUB1 = 'X'.

      • MODIFY IT_DATA_SUB TRANSPORTING ERR_SUB1.

      • ENDIF.

***

      • REFRESH BDCDATA.

***

***

      • ENDLOOP.

***

***ENDFORM. " sUB_upload

***

***

***

***

****&----


*-

***

****& Form SUB_UPLOAD1

****&----


*-

***

        • text

****----


*-

***

***FORM SUB_UPLOAD1 .

      • LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X'.

***

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '0110'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-ANLN1'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=MAST'.

      • PERFORM BDC_FIELD USING 'ANLA-ANLN1'

      • IT_DATA_SUB-ANLN1.

      • PERFORM BDC_FIELD USING 'ANLA-BUKRS'

      • IT_DATA_SUB-BUKRS.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB02'.

      • PERFORM BDC_FIELD USING 'ANLA-TXT50'

      • IT_DATA_SUB-TXT50.

****perform bdc_field using 'ANLH-ANLHTXT'

        • it_data_sub-ANLHTXT_004.

      • PERFORM BDC_FIELD USING 'ANLA-SERNR'

      • IT_DATA_SUB-SERNR.

      • PERFORM BDC_FIELD USING 'ANLA-MENGE'

      • IT_DATA_SUB-MENGE.

****perform bdc_field using 'ANLA-MEINS'

        • it_data_sub-MEINS_007.

****perform bdc_field using 'RA02S-XHIST'

        • it_data_sub-XHIST_008.

      • PERFORM BDC_FIELD USING 'ANLA-INVZU'

      • IT_DATA_SUB-INVZU.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-AKTIV'.

      • PERFORM BDC_FIELD USING 'ANLA-AKTIV'

      • IT_DATA_SUB-AKTIV.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB03'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLZ-GSBER'.

****perform bdc_field using 'ANLZ-GSBER'

        • it_data_sub-GSBER_011.

****perform bdc_field using 'ANLZ-KOSTL'

        • it_data_sub-KOSTL_012.

      • PERFORM BDC_FIELD USING 'ANLZ-STORT'

      • IT_DATA_SUB-STORT.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB04'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-ORD41'.

      • PERFORM BDC_FIELD USING 'ANLA-ORD41'

      • IT_DATA_SUB-ORD41.

      • PERFORM BDC_FIELD USING 'ANLA-ORD42'

      • IT_DATA_SUB-ORD42.

****perform bdc_field using 'RA02S-EQANZ'

        • it_data_sub-EQANZ_016.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB07'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-LIFNR'.

      • PERFORM BDC_FIELD USING 'ANLA-LIFNR'

      • IT_DATA_SUB-LIFNR.

****perform bdc_field using 'ANLA-LIEFE'

        • IT_DATA_SUB-LIEFE.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=TAB08'.

***

***

******************************************

        • PERFORM BDC_FIELD USING 'BDC_CURSOR'

        • 'ANLA-LEART'.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=SELZ'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'T093T-AFBKTX(01)'.

      • PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLB-NDPER'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=ALTD'.

      • PERFORM BDC_FIELD USING 'ANLB-NDJAR'

      • IT_DATA_SUB-NDJAR.

      • PERFORM BDC_FIELD USING 'ANLB-NDPER'

      • IT_DATA_SUB-NDPER.

****perform bdc_field using 'ANLB-AFABG'

        • record-AFABG_029.

      • PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-ANLN1'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=ALTB'.

***

******************************************

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'

      • IT_DATA_SUB-ANBTR01_01.

***

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'

      • IT_DATA_SUB-ANBTR01_06.

***

***

********************************************

***

***

      • PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '/00'.

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'

      • IT_DATA_SUB-BZDAT.

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'

      • IT_DATA_SUB-BWASL.

      • PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'

      • IT_DATA_SUB-ANBTR01.

      • PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.

      • PERFORM BDC_FIELD USING 'BDC_CURSOR'

      • 'ANLA-ANLN1'.

      • PERFORM BDC_FIELD USING 'BDC_OKCODE'

      • '=BUCH'.

****perform bdc_transaction using 'AS94'.

***

      • REFRESH MESSTAB.

      • CALL TRANSACTION 'AS94' USING BDCDATA

      • MODE H_MODE

      • UPDATE 'S'

      • MESSAGES INTO MESSTAB.

      • IF SY-SUBRC = 0.

        • READ TABLE MESSTAB INDEX 1.

        • IT_DATA_sub-SUB_CODE = MESSTAB-MSGV1.

      • DATA AN1 TYPE ANLN1.

      • DATA AN2 TYPE ANLN2.

      • GET PARAMETER ID 'AN2' FIELD AN2.

      • IT_DATA_SUB-SUB_CODE = AN2. "MESSTAB-MSGV1.

***

      • MODIFY IT_DATA_SUB TRANSPORTING SUB_CODE.

      • ELSE.

      • IT_DATA_SUB-ERR_SUB1 = 'X'.

      • MODIFY IT_DATA_SUB TRANSPORTING ERR_SUB1.

      • ENDIF.

***

      • REFRESH BDCDATA.

***

***

      • ENDLOOP.

***

***ENDFORM. " sUB_upload

<b>Reward Points for Useful Answers</b>

Regards

Gokul

0 Kudos

Thank u ..

can u send me INCLUDE ZASSET_INC .

i dont have this ..

Regards,

pandu

0 Kudos

Hi,

It is the generated include program when you record in SHDB.

<b>Reward points if Useful

Close the Thread if you got your Answer</b>

Regards

Gokul