BDC recording (MIR7) using SM35
Hi all,
I used the BDC for recording actions on Transaction MIR7. After recording, I try to process again the recorded procedure. However, the error of subrc return 1001 and have the message " Field INVFO-ZFBDT . is not an input field " When I process the transaction, it requires me to enter the field, but when I run that in the recorded mode, such error comes out. Can anyone suggest me a solution to solve this problem?
Number 1
Transaction MIR7
SY-SUBRC 1,001
Messages Field INVFO-ZFBDT . is not an input field
Regards,
Mandy
hey mandy,
well i havent worked for recording on transaction mir7 so i wud not be able to tell u about the fields nd all present there.
but i wud suggest that u do the recording again on "shdb" and then try and pass all the mandatory values.
take care
reward if helpful in any way
Similar Messages
-
How to overcome view changes in bdc session method using recording ?
how to overcome view changes in bdc session method using recording ?
ex-for mm01 in recording if i selected views basic data1 and basic data2.
i seheduleded for background for after 3 days .
if any body changes views by selecting other views also.
how to overcome this with out programming ?
is there any settings ?Hi,
I am attaching few threads.Hope these will help you.
If there are any error records in session, all those error records will get poulated in log .SM35 and after the session is completed , u can see error records which can be corrected and reprocessed again
We have the structures BDCLD and BDCLM, which will capture the log details inthe session. Firstly, sesssion should be processed. After that log will be created. Then caputure the information into an internal table using BDCLM and BDCLD.
and refer the link.
error correction in bdc session
regards
Madhu -
How to use BDC recording in Workflow.
Hi experts,
Anyone kindly help me for the following case...
If sales order gets created, mail has to be sent to every user. Also for that sales order, delivery should be created in background and again mail has to be sent to all users...
I m clear with sending mail. but i m struggled while creating delivery in background. i dont know how to do this. I hav an idea that it can be created using BDC recording and this recording program can be called in our method which is created in our business object.
How to create a single BDC recording to create sales order as well as creating delivery in background... Is it possible to do like this. Or is there any function module to create delivery in background with respect to sales order number?
kindly give some suggestion and step by step procedure to do this...
Thanks in advance...
Regards
Raaams...Hi Ram
Check this BAPI once BAPI_OUTB_DELIVERY_CREATE_SLS.
If this doesnt help do BDC recording and create a FM with the help of BDC recording. Please note that Call Transaction should happen in background otherwise your BDC wont work.
Please revert back if you have any queries.
Regards,
Gautham Paspala -
To display flatfile rec's under 1 Alternative BOM using BDc recording.
Hi,
I m trying to display flat file entire(i.e.. 4 rec's i m using) records vertically under one (Alternative BOM) for CS01-BOM using BDC recording method.
Now i m tried with the following code,i m getting as one (Alternative BOM) for one ff record,by replacing one by one.
But i want as vertically under one (Alternative BOM).
Can anyone help me to overcome this.
report ZBOM
no standard page heading line-size 255.
*include bdcrecx1.
DATA: BEGIN OF bdc OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF BDC.
DATA: BEGIN OF BDC1 OCCURS 0,
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF bdc1.
DATA: BEGIN OF BDCDATA OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF BDCDATA.
data ibdcdata type standard table of bdcdata WITH header line.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = BDCDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*perform open_group.
loop at bdcdata.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
'SOFTDRINKS'.
perform bdc_field using 'RC29N-WERKS'
'WIND'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(001)'
BDCDATA-IDNRK.
perform bdc_field using 'RC29P-MENGE(001)'
BDCDATA-MENGE.
perform bdc_field using 'RC29P-MEINS(001)'
BDCDATA-MEINS.
perform bdc_field using 'RC29P-POSTP(001)'
BDCDATA-POSTP.
perform bdc_dynpro using 'SAPLCSDI' '0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
perform bdc_field using 'RC29P-POSNR'
BDCDATA-POSNR. "'0010'.
perform bdc_field using 'RC29P-IDNRK'
BDCDATA-IDNRK. "'15'.
perform bdc_field using 'RC29P-MENGE'
BDCDATA-MENGE. "'1'.
perform bdc_field using 'RC29P-MEINS'
BDCDATA-MEINS. "'ml'.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
*perform bdc_transaction using 'CS01'.
*perform close_group.
CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
REFRESH IBDCDATA.
clear ibdcdata.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR iBDCDATA.
iBDCDATA-PROGRAM = PROGRAM.
iBDCDATA-DYNPRO = DYNPRO.
iBDCDATA-DYNBEGIN = 'X'.
APPEND ibDCDATA .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL NODATA.
CLEAR iBDCDATA.
iBDCDATA-FNAM = FNAM.
iBDCDATA-FVAL = FVAL.
APPEND iBDCDATA .
ENDIF.
ENDFORM.Hi Dilip,
Please change your code.
I request you to please go through BDC tutorials before even starting to write the program.
There are many online tutorials which can help you with.
Also, search in SDN.. there you will get more than thousand results.. with the search term BDC.
Take this suggestion seriously before nayone reports the moderators that u have been posting this thread daily without taking into consideration the previous replies.
Regards,
Vishwa. -
Problem uploding flatfile in bom(cs01) using bdc recording
Hi,
I had a problem while uploading flatfile records in bom(cs01) by using bdc recording.
I had four records in flatfile(.txt & xl), i.e., header data with its components.
Sample material:
(Header data) (components)
SOFTDRINKS,WIND,1, ' 14','1','ml','l'
SOFTDRINKS,WIND,1, '11','1','ml','l'
SOFTDRINKS,WIND,1, '13','1','ml','l'
SOFTDRINKS,WIND,1, ' 15','1','ml','l'
while executing, the same component entered while recording has been displayed four times not the ff records.
So, i want to know whether whether ff structure is ok or not,
whether coding is correct or not?
report ZBOM1
no standard page heading line-size 255.
*include bdcrecx1.
DATA: BEGIN OF bdc OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF BDC.
DATA: BEGIN OF BDC1 OCCURS 0,
idnrk(40),
MENGE(13),
MEINS(3),
postp(1),
END OF bdc1.
DATA: BEGIN OF BDCDATA OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
END OF BDCDATA.
data: ibdcdata type standard table of bdcdata with header line.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = BDCDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*perform open_group.
loop at bdcdata.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
'SOFTDRINKS'.
perform bdc_field using 'RC29N-WERKS'
'WIND'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(01)'
'11'.
perform bdc_field using 'RC29P-MENGE(01)'
'1'.
perform bdc_field using 'RC29P-MEINS(01)'
'ml'.
perform bdc_field using 'RC29P-POSTP(01)'
'l'.
perform bdc_dynpro using 'SAPLCSDI' '0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
perform bdc_field using 'RC29P-POSNR'
'0010'.
perform bdc_field using 'RC29P-IDNRK'
'11'.
perform bdc_field using 'RC29P-MENGE'
'1'.
perform bdc_field using 'RC29P-MEINS'
'ML'.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
*perform bdc_transaction using 'CS01'.
*perform close_group.
CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
REFRESH IBDCDATA.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR iBDCDATA.
iBDCDATA-PROGRAM = PROGRAM.
iBDCDATA-DYNPRO = DYNPRO.
iBDCDATA-DYNBEGIN = 'X'.
APPEND ibDCDATA .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR iBDCDATA.
iBDCDATA-FNAM = FNAM.
iBDCDATA-FVAL = FVAL.
APPEND iBDCDATA .
ENDIF.Hi Dilip,
You are reading your flat file into an internal table, you perform a LOOP over the read itab, but you are not using your BDCDATA data anywhere into IBDCDATA internal table! Those data have to be filled into FVAL parameter.
Here an additional hint:
1. The content of flat file is delivered as a STRING in GUI_UPLOAD. First you have to post these values into a structured internal table. And then perform the LOOP at this structured table.
2. In the new ABAP concept newer ever user Header Lines (in an internal table). One reason: Header Lines are not allowed in ABAP Objects. Instead use
LOOP AT itab into wa_structure.
*do something with wa_structure
APPEND wa_structure to IBDCDATA.
ENDLOOP.
Good success,
Heinz -
Sample code creating BOM for CS01 using BDC recording.
Hi,
Can anyone give me sample coding creating BOM for CS01 using BDC recording.
I want to display the flat file records,under one (Alternative BOM).
I m already working on it,but i m getting one A.BOM for each records.
[ Header data ] [ Item Data ]
SOFTDRINKS WIND 1 13 1 ml l
SOFTDRINKS WIND 1 11 1 ml l
SOFTDRINKS WIND 1 15 1 ml l
SOFTDRINKS WIND 1 14 1 ml l
Code:
report ZBOM
no standard page heading line-size 255.
*include bdcrecx1.
*DATA: BEGIN OF bdc OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF BDC.
*DATA: BEGIN OF BDC1 OCCURS 0,
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF bdc1.
DATA: BEGIN OF BDCDATA OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF BDCDATA.
data ibdcdata type standard table of bdcdata WITH header line.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = BDCDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*perform open_group.
loop at bdcdata.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
'SOFTDRINKS'.
perform bdc_field using 'RC29N-WERKS'
'WIND'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(001)'
BDCDATA-IDNRK.
perform bdc_field using 'RC29P-MENGE(001)'
BDCDATA-MENGE.
perform bdc_field using 'RC29P-MEINS(001)'
BDCDATA-MEINS.
perform bdc_field using 'RC29P-POSTP(001)'
BDCDATA-POSTP.
perform bdc_dynpro using 'SAPLCSDI' '0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
perform bdc_field using 'RC29P-POSNR'
BDCDATA-POSNR. "'0010'.
perform bdc_field using 'RC29P-IDNRK'
BDCDATA-IDNRK. "'15'.
perform bdc_field using 'RC29P-MENGE'
BDCDATA-MENGE. "'1'.
perform bdc_field using 'RC29P-MEINS'
BDCDATA-MEINS. "'ml'.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
*perform bdc_transaction using 'CS01'.
*perform close_group.
CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
REFRESH IBDCDATA.
clear ibdcdata.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR iBDCDATA.
iBDCDATA-PROGRAM = PROGRAM.
iBDCDATA-DYNPRO = DYNPRO.
iBDCDATA-DYNBEGIN = 'X'.
APPEND ibDCDATA .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR iBDCDATA.
iBDCDATA-FNAM = FNAM.
iBDCDATA-FVAL = FVAL.
APPEND iBDCDATA .
ENDIF.
ENDFORM.Hi,
I tried with the sample code but i m not getting the required result.
Can anyone give some other soln.
Code:
REPORT ZBOM2
no standard page heading line-size 255.
*include bdcrecx1.
TYPES: BEGIN OF TY_FLAT, " structure for flat file
STRING(200),
END OF TY_FLAT.
TYPES: BEGIN OF TY_HEAD, " structure for header file
IND(2) TYPE N,
MATNR(18),
WERKS(4),
STLAN(1),
END OF TY_HEAD.
TYPES : BEGIN OF TY_ITEM, "structure for item file
IND(2) TYPE N,
POSTP(1),
IDNRK(18),
MENGE(13),
meins(3),
END OF TY_ITEM.
TYPES :BEGIN OF TY_FLAT1, " structure for final file
MATNR(18),
WERKS(4),
STLAN(1),
posnr(4),
POSTP(1),
IDNRK(18),
MENGE(13),
meins(3),
END OF TY_FLAT1.
INTERNAL TABLE DECLERATIONS:
DATA : T_FLAT TYPE STANDARD TABLE OF TY_FLAT,
T_FLAT1 TYPE STANDARD TABLE OF TY_FLAT1,
T_HEAD TYPE STANDARD TABLE OF TY_HEAD,
T_ITEM TYPE STANDARD TABLE OF TY_ITEM,
T_BDCDATA TYPE STANDARD TABLE OF BDCDATA with header line ,
T_BDCMSG TYPE STANDARD TABLE OF BDCMSGCOLL.
WORK AREA DECLERATIONS:
DATA : ST_FLAT TYPE TY_FLAT,
ST_FLAT1 TYPE TY_FLAT1,
ST_HEAD TYPE TY_HEAD,
ST_ITEM TYPE TY_ITEM,
ST_BDCDATA TYPE BDCDATA,
ST_BDCMSG TYPE BDCMSGCOLL.
VARIABLES:
DATA : FNAM TYPE LOCALFILE, "rlgrap-filename,
FTYP TYPE RLGRAP-FILETYPE,
LF_FNAM TYPE STRING.
DATA : V_IND(2) TYPE N, " value 1,
V_FLD(20),
V_NO(2) TYPE N.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = T_FLAT
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
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 T_FLAT INTO ST_FLAT.
SPLIT ST_FLAT AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
INTO ST_FLAT1-MATNR ST_FLAT1-WERKS
ST_FLAT1-STLAN ST_FLAT1-POSTP
ST_FLAT1-IDNRK ST_FLAT1-MENGE ST_FLAT1-MEINS.
APPEND ST_FLAT1 TO T_FLAT1.
CLEAR ST_FLAT1.
ENDLOOP.
SORT T_FLAT1 BY MATNR WERKS STLAN POSTP IDNRK MENGE MEINS.
LOOP AT T_FLAT1 INTO ST_FLAT1.
MOVE :
ST_FLAT1-MATNR TO ST_HEAD-MATNR,
ST_FLAT1-WERKS TO ST_HEAD-WERKS,
ST_FLAT1-STLAN TO ST_HEAD-STLAN,
ST_FLAT1-POSTP TO ST_ITEM-POSTP,
ST_FLAT1-IDNRK TO ST_ITEM-IDNRK,
ST_FLAT1-MENGE TO ST_ITEM-MENGE,
ST_FLAT1-MENGE TO ST_ITEM-MEINS.
AT new STLAN.
ADD 1 TO V_IND.
ENDAT.
MOVE V_IND TO ST_HEAD-IND.
MOVE V_IND TO ST_ITEM-IND.
APPEND ST_HEAD TO T_HEAD.
APPEND ST_ITEM TO T_ITEM.
CLEAR ST_HEAD.
CLEAR ST_ITEM.
ENDLOOP.
CLEAR V_IND.
*perform open_group.
SORT T_ITEM BY IND.
SORT T_HEAD BY IND.
DELETE ADJACENT DUPLICATES FROM T_HEAD.
LOOP AT T_HEAD INTO ST_HEAD.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
ST_HEAD-MATNR.
perform bdc_field using 'RC29N-WERKS'
ST_HEAD-WERKS.
perform bdc_field using 'RC29N-STLAN'
ST_HEAD-STLAN.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
LOOP AT T_ITEM INTO ST_ITEM WHERE IND = ST_HEAD-IND.
ADD 1 TO V_NO.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-MENGE(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(01)'
ST_ITEM-IDNRK.
perform bdc_field using 'RC29P-MENGE(01)'
ST_ITEM-MENGE.
perform bdc_field using 'RC29P-MEINS(01)'
ST_ITEM-MEINS.
perform bdc_field using 'RC29P-POSTP(01)'
ST_ITEM-POSTP.
CONCATENATE 'RC29K-IDNRK(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-IDNRK.
CONCATENATE 'RC29K-MENGE(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-MENGE.
CONCATENATE 'RC29K-MEINS(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-MEINS.
CONCATENATE 'RC29K-POSTP(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-POSTP.
V_NO = 1.
ENDLOOP.
CLEAR V_NO.
*perform bdc_dynpro using 'SAPLCSDI' '0130'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
*perform bdc_field using 'RC29P-POSNR'
POSNR.
*perform bdc_field using 'RC29P-IDNRK'
bdcdata-IDNRK.
*perform bdc_field using 'RC29P-MENGE'
bdcdata-MENGE.
*perform bdc_field using 'RC29P-MEINS'
bdcdata-MEINS.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
perform bdc_dynpro using 'SAPLCSDI' '0133'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-matkl'.
perform bdc_field using 'RC29P-SANKA'
'zv01'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-POSNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
*perform bdc_transaction using 'CS01'.
perform close_group.
CALL TRANSACTION 'CS01' USING t_bdcdata MODE 'A' UPDATE 'S'.
REFRESH t_bdcdata.
clear t_bdcdata.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR st_bdcdata.
st_bdcdata-PROGRAM = PROGRAM.
st_bdcdata-DYNPRO = DYNPRO.
st_bdcdata-DYNBEGIN = 'X'.
APPEND st_bdcdata to t_bdcdata .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR st_bdcdata.
st_bdcdata-FNAM = FNAM.
st_bdcdata-FVAL = FVAL.
APPEND st_bdcdata to t_bdcdata.
ENDIF.
ENDFORM. -
Hi,
What is the best and easiest way to determine the list of programs in SAP (standard or custom) that uses SM35? Is there a table somewhere that stores this information?
Thanks,
GeneMaybe one way is to do a where-used on the function module BDC_CLOSE_GROUP or BDC_OPEN_GROUP or BDC_INSERT.
Regards,
Rich Heilman -
Handling popups in bdc recording
Hi,
I am doing bdc recording for a transaction, and there is a popup screen to be handled by the user, but when i am doing recording it is not recording the popup menus. can you please tel me how i can handle popups in BDC recording.
It is very urgent.
Thank you.Hi Ameen,
Award points if useful...
Step by Step approach to ceate simple BDC session program using reusable template.
This step by step approach can be used to create a Simple BDC program i.e for a transaction which does not have any table control / looping at screen table. The same can also be enhanced to develop a program for transactions involving table controls .
1. Create a new program as executable program using SE38 transaction code.
2. Copy the following template code into your program .
---- Start of Template -
REPORT NO STANDARD PAGE HEADING LINE-SIZE 200 LINE-COUNT 300.
*-- DATA DECLARATION--
*---Types
DATA : BEGIN OF t_upload,
FIELD1(10),
FIELD2(2),
FIELD3(18),
FIELD4(35),
END OF t_upload.
*--- Tables
DATA : BEGIN OF i_bdcdata OCCURS 0."to hold the transaction record
INCLUDE STRUCTURE bdcdata.
DATA: END OF i_bdcdata.
DATA: i_upload LIKE STANDARD TABLE OF t_upload," to hold file data.
i_upload1 LIKE STANDARD TABLE OF t_upload." to hold file data.
*--- Work Areas
DATA: wa_upload2 LIKE t_upload,
wa_upload LIKE t_upload,
wa_upload1 LIKE t_upload.
*--- Variables
DATA: v_count1(4) TYPE n,
v_error TYPE c,
v_session(12),
v_field(21) TYPE c,
v_message(60) type 'C'.
*--Constants
DATA: c_open TYPE c VALUE '(',
c_close TYPE c VALUE ')',
c_x TYPE c VALUE 'X'.
*---Initialisation
initialization.
refresh : i_upload , i_upload1 ,i_bdcdata.
-------Selection Screen Design -
*Selection screen for input of upload file address
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
---AT SELECTION SCREEN -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*--For popup to select file.
PERFORM give_help.
-----START OF SELECTION -
START-OF-SELECTION.
*--Data upload using WS_Upload.
PERFORM get_data.
*-- OPEN SESSION
PERFORM open_group.
*--Insert transactions using BDCDATA table in the session.
PERFORM do_transaction .
*-- Close the session.
PERFORM close_group.
END-OF-SELECTION.
*& Form f_get_data
For data upload from external file.
FORM get_data.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_upload
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
DELETE I_UPLOAD INDEX 1.
ENDIF.
ENDFORM. " f_get_data
*& Form F_open_group
To open session in session management.
FORM open_group.
v_session = 'TCODE'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = v_session
user = sy-uname
keep = 'X'.
ENDFORM. " F_open_group
*& Form f_do_transaction
Insert transactions in session after passing values to BDCDATA
FORM do_transaction.
LOOP AT i_upload INTO wa_upload .
*---- insert your generated codes from recording at SHDB here
*----- insertion ends
perform bdc_transaction using 'TCODE'.
REFRESH : I_BDCDATA.
CLEAR : WA_UPLOAD.
ENDIF.
ENDLOOP.
ENDFORM. " f_do_transaction
*& Form bdc_dynpro
For appending screen details to BDCDATA
FORM bdc_dynpro USING program dynpro.
CLEAR i_bdcdata.
i_bdcdata-program = program.
i_bdcdata-dynpro = dynpro.
i_bdcdata-dynbegin = 'X'.
APPEND i_bdcdata.
CLEAR i_bdcdata.
ENDFORM. "bdc_dynpro
*& Form bdc_field
For appending field details to bdcdata table
FORM bdc_field USING fnam fval.
CLEAR i_bdcdata.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
APPEND i_bdcdata.
CLEAR i_bdcdata.
ENDFORM. " bdc_field
*& Form bdc_transaction
For inserting Transaction in the session
FORM bdc_transaction USING tcode.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = tcode
TABLES
dynprotab = i_bdcdata.
ENDFORM. " bdc_transaction
*& Form F_close_group
For closing the session created in Session manager SM35
FORM close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
concatenate 'Session ' v_session 'successfully created' into v_field.
MESSAGE v_field type 'I'..
CALL TRANSACTION 'SM35'.
ENDFORM. "f_close_group
*& Form f_give_help
For user help to select file
FORM give_help.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
mask = ',.,..'
mode = 'O'
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0 AND NOT sy-msgty IS INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f_give_help
---- End of Template -
3.Go to the transaction SHDB in another session ( you can also give TCODE - OSHDB in transaction code window and hit enter ).
4.Create you transaction recording in SHDB . Ensure your transaction recording takes care of input values to all the
fields to which you intend to pass values in the BDC.
5.Once your recording is done correctly create the program from recording in the SHDB transction . You will find the button to create program in SHDB . Choose the option of creating from file when you proceed through the subsequent steps.
6. Define data type t_upload and structure wa_upload in the template program with fields of structure 'RECORD' from the program generated using SHDB recording ( replace the field1, field2 and so on as per your requirement). For your understanding you can remove the suffixes to the
field name but keep the field size unchanged.
7.Copy the coding existing between 'do' and 'enddo' statement from the generated program . Insert the copied code between the loop and endloop code of form 'Do_transaction '. Replace fields of structure 'RECORD' with respective fields of structure wa_upload.Insert constant values wherever possible in transaction recording.You can also handle customised data conversions here.
8.Replace 'TCODE' in the template program with the transaction code you intend to process in this BDC.
9.Please carry out further syntax check and resolve the related issues.
This program will provide for input help to select upload file from local machine. The file needs to be in Tab delimited format and is assumed to have first row as column headers .
On successful creation of session you will be prompted with a Information popup giving the name of session ,and will take you to the SM35 transaction to process your session. -
BDC Recording for uploading data into Fi01
HI,
I need to upload date from a file into SAP Fi01 transaction
i used a sample program and added my bdc recording to it as per instrucrion
there is a error while uploading.
i believe it is at the place i am pointing in bold. it is at read dataset. could you advice me how to solve it.
CODE:
REPORT Z_BANK_DIRECTORY
NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 300.
*-- DATA DECLARATION--
*---Types
DATA : BEGIN OF t_upload,
data element: BANKS
BANKS_001(003),
data element: BANKK
BANKL_002(015),
data element: BANKA
BANKA_003(060),
data element: REGIO
PROVZ_004(003),
data element: STRAS_GP
STRAS_005(035),
data element: ORT01_GP
ORT01_006(035),
data element: BRNCH
BRNCH_007(040),
data element: SWIFT
SWIFT_008(011),
data element: BGRUP
BGRUP_009(002),
data element: AD_TITLETX
TITLE_MEDI_010(030),
data element: AD_NAME1
NAME1_011(040),
data element: AD_STRSPP1
STR_SUPPL1_012(040),
data element: AD_STRSPP2
STR_SUPPL2_013(040),
data element: AD_STREET
STREET_014(060),
data element: AD_CITY2
CITY2_015(040),
data element: AD_CITY3
HOME_CITY_016(040),
data element: AD_PSTCD1
POST_CODE1_017(010),
data element: LAND1
COUNTRY_018(003),
data element: AD_POBX
PO_BOX_019(010),
data element: AD_PSTCD2
POST_CODE2_020(010),
data element: SPRAS
LANGU_021(002),
data element: AD_TLNMBR1
TEL_NUMBER_022(030),
data element: AD_MBNMBR1
MOB_NUMBER_023(030),
data element: AD_FXNMBR1
FAX_NUMBER_024(030),
data element: AD_SMTPADR
SMTP_ADDR_025(132),
data element: BANKA
BANKA_026(060),
data element: REGIO
PROVZ_027(003),
data element: STRAS_GP
STRAS_028(035),
data element: ORT01_GP
ORT01_029(035),
data element: BRNCH
BRNCH_030(040),
data element: SWIFT
SWIFT_031(011),
data element: BGRUP
BGRUP_032(002),
END OF t_upload.
*--- Tables
DATA : BEGIN OF i_bdcdata OCCURS 0."to hold the transaction t_upload
INCLUDE STRUCTURE bdcdata.
DATA: END OF i_bdcdata.
DATA: i_upload LIKE STANDARD TABLE OF t_upload," to hold file data.
i_upload1 LIKE STANDARD TABLE OF t_upload." to hold file data.
*--- Work Areas
DATA: wa_upload2 LIKE t_upload,
wa_upload LIKE t_upload,
wa_upload1 LIKE t_upload.
*--- Variables
DATA: v_count1(4) TYPE n,
v_error TYPE c,
v_session(12),
v_field(21) TYPE c,
v_message(60) type C.
*--Constants
DATA: c_open TYPE c VALUE '(',
c_close TYPE c VALUE ')',
c_x TYPE c VALUE 'X'.
*---Initialisation
initialization.
refresh : i_upload , i_upload1 ,i_bdcdata.
-------Selection Screen Design -
*Selection screen for input of upload file address
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
---AT SELECTION SCREEN -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*--For popup to select file.
PERFORM give_help.
-----START OF SELECTION -
START-OF-SELECTION.
*--Data upload using WS_Upload.
PERFORM get_data.
*-- OPEN SESSION
PERFORM open_group.
*--Insert transactions using BDCDATA table in the session.
PERFORM do_transaction .
*-- Close the session.
PERFORM close_group.
END-OF-SELECTION.
*& Form f_get_data
For data upload from external file.
FORM get_data.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_upload
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
DELETE I_UPLOAD INDEX 1.
ENDIF.
ENDFORM. " f_get_data
*& Form F_open_group
To open session in session management.
FORM open_group.
v_session = 'FI01'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = v_session
user = sy-uname
keep = 'X'.
ENDFORM. " F_open_group
*& Form f_do_transaction
Insert transactions in session after passing values to BDCDATA
FORM do_transaction.
LOOP AT i_upload INTO wa_upload .
*---- insert your generated codes from recording at SHDB here
read dataset <b>wa_upload</b> into t_upload.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPMF02B' '0100'.
perform bdc_field using 'BDC_CURSOR'
'BNKA-BANKL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BNKA-BANKS'
t_upload-BANKS_001.
perform bdc_field using 'BNKA-BANKL'
t_upload-BANKL_002.
perform bdc_dynpro using 'SAPMF02B' '0110'.
perform bdc_field using 'BDC_CURSOR'
'BNKA-BGRUP'.
perform bdc_field using 'BDC_OKCODE'
'=ADDR'.
perform bdc_field using 'BNKA-BANKA'
t_upload-BANKA_003.
perform bdc_field using 'BNKA-PROVZ'
t_upload-PROVZ_004.
perform bdc_field using 'BNKA-STRAS'
t_upload-STRAS_005.
perform bdc_field using 'BNKA-ORT01'
t_upload-ORT01_006.
perform bdc_field using 'BNKA-BRNCH'
t_upload-BRNCH_007.
perform bdc_field using 'BNKA-SWIFT'
t_upload-SWIFT_008.
perform bdc_field using 'BNKA-BGRUP'
t_upload-BGRUP_009.
perform bdc_dynpro using 'SAPLSZA1' '0201'.
perform bdc_field using 'BDC_CURSOR'
'SZA1_D0100-SMTP_ADDR'.
perform bdc_field using 'BDC_OKCODE'
'=CONT'.
perform bdc_field using 'SZA1_D0100-TITLE_MEDI'
t_upload-TITLE_MEDI_010.
perform bdc_field using 'ADDR1_DATA-NAME1'
t_upload-NAME1_011.
perform bdc_field using 'ADDR1_DATA-STR_SUPPL1'
t_upload-STR_SUPPL1_012.
perform bdc_field using 'ADDR1_DATA-STR_SUPPL2'
t_upload-STR_SUPPL2_013.
perform bdc_field using 'ADDR1_DATA-STREET'
t_upload-STREET_014.
perform bdc_field using 'ADDR1_DATA-CITY2'
t_upload-CITY2_015.
perform bdc_field using 'ADDR1_DATA-HOME_CITY'
t_upload-HOME_CITY_016.
perform bdc_field using 'ADDR1_DATA-POST_CODE1'
t_upload-POST_CODE1_017.
perform bdc_field using 'ADDR1_DATA-COUNTRY'
t_upload-COUNTRY_018.
perform bdc_field using 'ADDR1_DATA-PO_BOX'
t_upload-PO_BOX_019.
perform bdc_field using 'ADDR1_DATA-POST_CODE2'
t_upload-POST_CODE2_020.
perform bdc_field using 'ADDR1_DATA-LANGU'
t_upload-LANGU_021.
perform bdc_field using 'SZA1_D0100-TEL_NUMBER'
t_upload-TEL_NUMBER_022.
perform bdc_field using 'SZA1_D0100-MOB_NUMBER'
t_upload-MOB_NUMBER_023.
perform bdc_field using 'SZA1_D0100-FAX_NUMBER'
t_upload-FAX_NUMBER_024.
perform bdc_field using 'SZA1_D0100-SMTP_ADDR'
t_upload-SMTP_ADDR_025.
perform bdc_dynpro using 'SAPMF02B' '0110'.
perform bdc_field using 'BDC_CURSOR'
'BNKA-BANKA'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_field using 'BNKA-BANKA'
t_upload-BANKA_026.
perform bdc_field using 'BNKA-PROVZ'
t_upload-PROVZ_027.
perform bdc_field using 'BNKA-STRAS'
t_upload-STRAS_028.
perform bdc_field using 'BNKA-ORT01'
t_upload-ORT01_029.
perform bdc_field using 'BNKA-BRNCH'
t_upload-BRNCH_030.
perform bdc_field using 'BNKA-SWIFT'
t_upload-SWIFT_031.
perform bdc_field using 'BNKA-BGRUP'
t_upload-BGRUP_032.
*----- insertion ends
perform bdc_transaction using 'FI01'.
REFRESH : I_BDCDATA.
CLEAR : WA_UPLOAD.
ENDIF.
ENDLOOP.
ENDFORM. " f_do_transaction
*& Form bdc_dynpro
For appending screen details to BDCDATA
FORM bdc_dynpro USING program dynpro.
CLEAR i_bdcdata.
i_bdcdata-program = program.
i_bdcdata-dynpro = dynpro.
i_bdcdata-dynbegin = 'X'.
APPEND i_bdcdata.
CLEAR i_bdcdata.
ENDFORM. "bdc_dynpro
*& Form bdc_field
For appending field details to bdcdata table
FORM bdc_field USING fnam fval.
CLEAR i_bdcdata.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
APPEND i_bdcdata.
CLEAR i_bdcdata.
ENDFORM. " bdc_field
*& Form bdc_transaction
For inserting Transaction in the session
FORM bdc_transaction USING tcode.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'FI01'
TABLES
dynprotab = i_bdcdata.
ENDFORM. " bdc_transaction
*& Form F_close_group
For closing the session created in Session manager SM35
FORM close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
concatenate 'Session ' v_session 'successfully created' into v_field.
MESSAGE v_field type 'I'..
CALL TRANSACTION 'SM35'.
ENDFORM. "f_close_group
*& Form f_give_help
For user help to select file
FORM give_help.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
mask = ',.,..'
mode = 'O'
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0 AND NOT sy-msgty IS INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f_give_help
---- End of Template -Actually, there is no need for the dataset statemant at all. Comment that out, and add a line that moves the data from wa_upload to t_upload, or you could change the rest of the references to point to wa_upload and forget about t_upload. Your choice.
LOOP AT i_upload INTO wa_upload .
*---- insert your generated codes from recording at SHDB here
*read dataset wa_upload into t_upload.
*f sy-subrc <> 0. exit. endif.
t_upload = wa_upload.
Regards,
RIch Heilman -
Hi I am having a problem in BDC Recording. My requirement is that when I input data in transaction fb02 to block the invoices, It shows a list of invoices. Now i need to double click that item(line) in which PK = 06 at runtime during bdc recording. During BDC recording it takes the line number on which we have clicked which is constant but i want it dynamic that if item 1 is having PK=6, that line should be double clicked and if item 3 is having PK=6, the third item should be double clicked to open another screen. Kindly help me... Thanks in advance.
Hi Ravi,
While writing your code that is in your code you know which line number is having the PK = 06, then you can use the same line number and add the code for double click after that.
Regards,
Atish -
hi gurus,
i am trying to do a material master creation using BDC recording,
i am new i dont know how to modify the code,
the following is the code, please let me know how to make changes.
report ZTEST95
no standard page heading line-size 255.
include bdcrecx1.
parameters: dataset(132) lower case default
'C:\Documents and Settings\Deskt'
& 'op\test95.txt'.
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: REF_MATNR
MATNR_004(040),
data element: XFELD
KZSEL_01_005(001),
data element: MAKTX
MAKTX_006(040),
data element: MEINS
MEINS_007(003),
data element: MATKL
MATKL_008(009),
data element: SPART
SPART_009(002),
data element: MTPOS_MARA
MTPOS_MARA_010(004),
data element: BRGEW
BRGEW_011(017),
data element: GEWEI
GEWEI_012(003),
data element: NTGEW
NTGEW_013(017),
end of record.
End generated data section ***
start-of-selection.
perform open_dataset using dataset.
perform open_group.
do.
read dataset dataset into record.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-MATNR'
record-MATNR_001.
perform bdc_field using 'RMMG1-MBRSH'
record-MBRSH_002.
perform bdc_field using 'RMMG1-MTART'
record-MTART_003.
perform bdc_field using 'RMMG1_REF-MATNR'
record-MATNR_004.
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)'
record-KZSEL_01_005.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX_006.
perform bdc_field using 'MARA-MEINS'
record-MEINS_007.
perform bdc_field using 'MARA-MATKL'
record-MATKL_008.
perform bdc_field using 'MARA-SPART'
record-SPART_009.
perform bdc_field using 'MARA-MTPOS_MARA'
record-MTPOS_MARA_010.
perform bdc_field using 'BDC_CURSOR'
'MARA-BRGEW'.
perform bdc_field using 'MARA-BRGEW'
record-BRGEW_011.
perform bdc_field using 'MARA-GEWEI'
record-GEWEI_012.
perform bdc_field using 'MARA-NTGEW'
record-NTGEW_013.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM01'.
enddo.
perform close_group.
perform close_dataset using dataset.
thanks.Hi,
It is better if the Material Master creation step is done by LSMW - Direct Input method with the following object:
Object 0020 Material master
Method 0000
Program name RMDATIND
Program type D Direct input
Check the program documentation for more details.
For a sample data file generation ( Sequential file ), check the program RMDATGEN
If the reqmt., is for a repetetive loading of Material Master you could schedule / execute the LSMW by following program: /SAPDMC/SAP_LSMW_INTERFACE.
Hope this helps.
Best Regards, Murugesh -
Need help for bdc recording TC fp05
Hi,
My requirement is: I want to create a Payment lot using fp05 and then post
it through a program.
First i want to know is there any BAPI available to do that.
I couldnt find any BAPI. That is why i did BDC Recording. The recording is working till Payment Lot creation. But after creation when i try to post the lot, it is giving status as "Direct Posting Stopped". Again if i come out of the program and then manually post it, it is working fine. But through program if i try to post it, it is giving status as "Direct Posting Stopped".
Is this because we cannot Post a Payment Lot programatically or some Authorisation issue is there.
Can anyone respond immediately
Regards,
SheronHi Raj,
May be this can be useful.
BAPI_INSPOPER_RECORDRESULTS
You can search other in se37 BAPIINSP.
Regards,
Amit Mittal. -
What is the tcode for bdc recording and how to do in hr-abap for pa and om
hi,
I need to do the bdc recording for pa and om. So, can any of you tell me how to do and what are the tcodes we have to use.
thanks & regards,
Sekhar.Hi ,
Here is the link from you will get all the transaction code
http://www.sap-basis-abap.com/saphr004.htm
As far PA specfic some tcodes are given below
PA20 Display HR Master Data
PA30 Maintain HR Master Data
PA40 Personnel Actions
PA41 Correct Actions
PA42 Fast Entry for Actions
PA46 Import from Resumix
PA47 Export to Resumix
PA48 Hiring from non-SAP system
PA51 Display Time Data
PA53 Display Time Data
PA61 Maintain Time Data
PA62 List Entry of Additional Data
PA63 Maintain Time Data
PA64 Calendar Entry
PA70 Fast Entry
PA71 Fast Entry of Time Data
PA88 Benefits
For OM specific
PP01 Maintain Plan Data (menu-guided) -
Problem In Converting BDC recording to program
Hi to all,
I have recorded ZMM01 using t-code MM01 to create material with accounting codes. Here i am able to create material with accounting codes. But when I am converting that into program there i am getting problem(not creating any material and not showing any error). So please guide me.
Any help would be appreciated .Have you tried executing your BDC program in debug mode with mode A? Also, are you trapping errors in BDCMSGCOLL structure?
Thanks,
Santosh -
Problem with SM37 BDC recording
Hi ,
I want to change the output device for the job scheduled of 1000 pgms in SM37.
For this i am using BDC recording.
But when i run the recording, it does not fill the data and does not move from 1 screen to other screen.
I have checked the recording, and everything got recorded.
Please suggest .
Thanks in advance.
Rgds/AbhiHi,
Why not make things simpler by using FM BP_CHANGE_JOB_STEP. Parameters required are:
JOBNAME
JOBCOUNT
STEP-PROGRAM & STEP-TYP (equal to 'A')
STEP_NUM
ALLPRIPAR-PDEST
Presumably you will have the info for JOBNAME, JOBCOUNT etc from your BDC feed. To preserve the rest of the print parameters then use something like FM BP_JOB_READ and fill in ALLPRIPAR fields.
Thanks,
Pete
Maybe you are looking for
-
How to call servlet from jsp in portal applicaton...??
JDeveloper - 11.1.1.6.0 Hii all, i am working on an portal application in which i have added my adf application as portlet.. in this adf application i am having an jsp page on the popup the action of this jsp page is set to an servlet <form id="form1
-
A deduction was made from my bank account on 10/19/12 by APPLE ITUNES STORE for a purchase and/or payment that I never made and nver authorized. I want to know why this $$$ was deducted and for what purpose. I ALSO WANT MY $$$ REFUNDED TO MY ACCOUNT
-
how do remap drive names and not lose project clip links to Event names...?
-
I'm trying to buy a game using a gift card but the only options that come up are ones for credit cards. It says redeem giftcard but I have already done this, so when I try this option again it says that this gift card as already been redeemed which i
-
Installing Oracle, patchset and CPU
I am building a new oracle server (Windows 2003 64-bit R2 SP2). I will be installing oracle 10.2 64-bit and patchset 10.2.0.4. Can you please let me know whether I can ialso nstall the latest oracle CPU before creating any database on the server? Reg