0% found this document useful (0 votes)
170 views2 pages

BDC

This document contains ABAP code that defines data structures and tables to populate transaction screen fields and submit background data using BDC calls. It loops through a table of material and description values, populates the fields of transaction CC02, and submits the transaction to create inspection lots.

Uploaded by

anon_468655827
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views2 pages

BDC

This document contains ABAP code that defines data structures and tables to populate transaction screen fields and submit background data using BDC calls. It loops through a table of material and description values, populates the fields of transaction CC02, and submits the transaction to create inspection lots.

Uploaded by

anon_468655827
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

REPORT zms6

NO STANDARD PAGE HEADING LINE-SIZE 255.

DATA : it_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.


DATA : wa_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA : it_mestab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

TYPES : BEGIN OF ty_data,


matnr TYPE mara-matnr,
desc TYPE c LENGTH 10,
END OF ty_data.

DATA : it_data TYPE TABLE OF ty_data,


wa_data TYPE ty_data.
*include bdcrecx1.

START-OF-SELECTION.

wa_data-matnr = 'BELECARD0008'.
wa_data-desc = 'test14'.
APPEND wa_data TO it_data.
CLEAR : wa_data.

wa_data-matnr = 'BELCCARD0035'.
wa_data-desc = 'test15'.
APPEND wa_data TO it_data.
CLEAR : wa_data.

*perform open_group.
LOOP AT it_data INTO wa_data.
CLEAR : it_bdcdata[], it_mestab[].
PERFORM bdc_dynpro USING 'SAPMC29C' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29A-AENNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29A-AENNR'
'500000000003'.
PERFORM bdc_dynpro USING 'SAPMC29C' '0010'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UEOB'.
PERFORM bdc_field USING 'RC29A-AETXT'
'test1'.
PERFORM bdc_field USING 'RC29A-DATUV'
'28.09.2017'.
PERFORM bdc_field USING 'RC29A-AEGRU'
'test1'.
PERFORM bdc_field USING 'RC29A-AENST'
'1'.
PERFORM bdc_dynpro USING 'SAPMC29C' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UESM'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29A-AENNR'.
PERFORM bdc_dynpro USING 'SAPMC29C' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ERFA'.
PERFORM bdc_dynpro USING 'SAPMC29C' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29A-OITXT(02)'.
PERFORM bdc_field USING 'RC29A-MATNR(02)'
wa_data-matnr. "'W0E1924Z'.
PERFORM bdc_field USING 'RC29A-WERKS(02)'
'5100'.
PERFORM bdc_field USING 'RC29A-STLAN(02)'
'1'.
PERFORM bdc_field USING 'RC29A-OITXT(02)'
wa_data-desc. "'test1'.
PERFORM bdc_dynpro USING 'SAPMC29C' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCBU'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29A-OITXT(01)'.
*perform bdc_transaction using 'CC02'.
*
*perform close_group.
CALL TRANSACTION 'CC02' USING it_bdcdata
MESSAGES INTO it_mestab
MODE 'N'
UPDATE 'S'.
ENDLOOP.
WRITE : 'Hi'.

*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR wa_bdcdata.
wa_bdcdata-program = program.
wa_bdcdata-dynpro = dynpro.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
ENDFORM. "bdc_dynpro

*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
* IF fval <> nodata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
APPEND wa_bdcdata TO it_bdcdata.
* ENDIF.
ENDFORM. "bdc_field

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy