0% found this document useful (0 votes)
8 views

SOURCE+CODE (38)

The document outlines a report for processing data in SAP using ABAP, specifically focusing on the conversion of XLSX files into SAP format. It includes instructions for defining data fields, generating data sections, and executing a series of function calls to handle data input and transactions. The report emphasizes not to modify the generated data section and provides a structured approach for handling various fields and transactions within SAP.

Uploaded by

greeshmakuderu2
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

SOURCE+CODE (38)

The document outlines a report for processing data in SAP using ABAP, specifically focusing on the conversion of XLSX files into SAP format. It includes instructions for defining data fields, generating data sections, and executing a series of function calls to handle data input and transactions. The report emphasizes not to modify the generated data section and provides a structured approach for handling various fields and transactions within SAP.

Uploaded by

greeshmakuderu2
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

report ZDBDC7

no standard page heading line-size 255.

* Include bdcrecx1_s:

* The call transaction using is called WITH AUTHORITY-CHECK!

* If you have own auth.-checks you can use include bdcrecx1 instead.

include bdcrecx1_s.

*parameters: dataset(132) lower case.

*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***

* If it is nessesary to change the data section use the rules:

* 1.) Each definition of a field exists of two lines

* 2.) The first line shows exactly the comment

* '* data element: ' followed with the data element

* which describes the field.

* If you don't have a data element use the

* comment without a data element name

* 3.) The second line shows the fieldname of the

* structure, the fieldname must consist of

* a fieldname and optional the character '_' and

* three numbers and the field length in brackets

* 4.) Each field must be type C.

*** Generated data section with specific formatting - DO NOT CHANGE ***

data: begin of record,

* data element: MATNR

MATNR_001(040),

* data element: MBRSH


MBRSH_002(001),

* data element: MTART

MTART_003(004),

* data element: XFELD

KZSEL_01_004(001),

* data element: MAKTX

MAKTX_005(040),

* data element: MEINS

MEINS_006(003),

end of record.

*** End generated data section ***

DATA : IT_TRUX TYPE TRUXS_T_TEXT_DATA,

LV_PATH TYPE RLGRAP-FILENAME VALUE 'C:\Users\s20abap24\Desktop\MARA.XLSX'.

TYPES : BEGIN OF TY_SEMI,

MATNR TYPE RMMG1-MATNR,

MBRSH TYPE RMMG1-MBRSH,

MTART TYPE RMMG1-MTART,

MAKTX TYPE MAKT-MAKTX,

MEINS TYPE MARA-MEINS,

END OF TY_SEMI.

DATA : IT_SEMI TYPE TABLE OF TY_SEMI,

WA_SEMI TYPE TY_SEMI.

start-of-selection.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

i_tab_raw_data = IT_TRUX

i_filename = LV_PATH

TABLES

i_tab_converted_data = IT_SEMI.

*perform open_dataset using dataset.

perform open_group.

LOOP AT IT_SEMI INTO WA_SEMI..

*read dataset dataset into record.

*if sy-subrc <> 0. exit. endif.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MTART'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'RMMG1-MATNR' WA_SEMI-MATNR.

* record-MATNR_001.

perform bdc_field using 'RMMG1-MBRSH' WA_SEMI-MBRSH.

* record-MBRSH_002.

perform bdc_field using 'RMMG1-MTART' WA_SEMI-MTART.

* record-MTART_003.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'


'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'.

* record-KZSEL_01_004.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'MAKT-MAKTX' WA_SEMI-MAKTX.

* record-MAKTX_005.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS' WA_SEMI-MEINS.

* record-MEINS_006.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

perform bdc_transaction using 'MM01'.

ENDLOOP.

perform close_group.

*perform close_dataset using dataset.

You might also like