0% found this document useful (0 votes)
31 views1 page

Clase 006

This document contains an ABAP program that uploads data from a text file into a internal table, loops through the table, and uses BDC calls to populate fields in transaction XK01 to create customer master records from the uploaded data. The program uploads a file located at 'C:\Users\ABAP-SAP\Desktop\datos2.txt' into an internal table with fields for name, country code, country, and language. It then performs BDC calls to transaction XK01 to create a customer for each row in the internal table, using the field values from the table to populate the required fields.

Uploaded by

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

Clase 006

This document contains an ABAP program that uploads data from a text file into a internal table, loops through the table, and uses BDC calls to populate fields in transaction XK01 to create customer master records from the uploaded data. The program uploads a file located at 'C:\Users\ABAP-SAP\Desktop\datos2.txt' into an internal table with fields for name, country code, country, and language. It then performs BDC calls to transaction XK01 to create a customer for each row in the internal table, using the field values from the table to populate the required fields.

Uploaded by

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

report ZCLASE006

no standard page heading line-size 255.


DATA: begin of it_tabla occurs 0,
nombre(30),
nomco(2),
pais(2),
idioma(2),
END OF it_tabla.
include bdcrecx1.
PARAMETERS:
p_user LIKE apqi-userid OBLIGATORY DEFAULT sy-uname, "user
p_fich LIKE rlgrap-filename OBLIGATORY
DEFAULT 'C:\Users\ABAP-SAP\Desktop\datos2.txt'.
start-of-selection.
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_fich
filetype = 'DAT'
TABLES
data_tab = it_tabla.
perform open_group.
LOOP AT it_tabla.
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-KTOKK'
'KRED'.
PERFORM bdc_dynpro USING 'SAPMF02K'
'0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-SPRAS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPDA'.
PERFORM bdc_field USING 'LFA1-NAME1'
it_tabla-nombre.
PERFORM bdc_field USING 'LFA1-SORTL'
it_tabla-nomco.
PERFORM bdc_field USING 'LFA1-LAND1'
it_tabla-pais.
PERFORM bdc_field USING 'LFA1-SPRAS'
it_tabla-idioma.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
perform close_group.

You might also like