BDC-mk02
<b>Hi experts,
I am Trying for objects which upload flat file in to table from tc MK02
I wrote programe as below
And after running this in sm35
table get update properly but at last it not getting close properly
It means it goes to again upload to 1st screen.
Please help me out of this:</b>
report ZSANDY_MK02
no standard page heading line-size 255.
*include bdcrecx1.
INITIALIZATION.
data: begin of itab occurs 0,
lifnr like RF02K-LIFNR,
ekorg like RF02K-EKORG,
anred like LFA1-ANRED,
name1 like LFA1-NAME1,
sortl like LFA1-SORTL,
name2 like LFA1-NAME2,
stras like LFA1-STRAS,
pfach like LFA1-PFACH,
ort01 like LFA1-ORT01,
pstlz like LFA1-PSTLZ,
ort02 like LFA1-ORT02,
pstl2 like LFA1-PSTL2,
land1 like LFA1-LAND1,
spras like LFA1-SPRAS,
telx1 like LFA1-TELX1,
TELF1 LIKE LFA1-TELF1,
end of itab.
DATA: BEGIN OF BDCDATA OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\SANDY\MK02.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = ITAB
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.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
DEST = FILLER8
GROUP = 'MK02'
HOLDDATE = FILLER8
KEEP = 'X'
USER = SY-UNAME
RECORD = FILLER1
PROG = SY-CPROG
IMPORTING
QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11
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 itab.
perform bdc_dynpro using 'SAPMF02K' '0108'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-D0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
ITAB-LIFNR.
perform bdc_field using 'RF02K-EKORG'
ITAB-EKORG.
perform bdc_field using 'RF02K-D0110'
'X'.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_field using 'LFA1-ANRED'
ITAB-ANRED.
perform bdc_field using 'LFA1-NAME1'
itab-name1.
perform bdc_field using 'LFA1-SORTL'
ITAB-SORTL.
perform bdc_field using 'LFA1-NAME2'
ITAB-NAME2.
perform bdc_field using 'LFA1-STRAS'
ITAB-STRAS.
perform bdc_field using 'LFA1-PFACH'
ITAB-PFACH.
perform bdc_field using 'LFA1-ORT01'
ITAB-ORT01.
perform bdc_field using 'LFA1-PSTLZ'
ITAB-PSTLZ.
perform bdc_field using 'LFA1-ORT02'
ITAB-ORT02.
perform bdc_field using 'LFA1-PSTL2'
ITAB-PSTL2.
perform bdc_field using 'LFA1-LAND1'
ITAB-LAND1.
perform bdc_field using 'LFA1-SPRAS'
ITAB-SPRAS.
perform bdc_field using 'LFA1-TELX1'
itab-telx1.
perform bdc_field using 'LFA1-TELF1'
itab-telF1.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MK02'
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
DYNPROTAB = BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR ITAB.
REFRESH BDCDATA.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL IS NOT INITIAL.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
<b>and this the in flat file;</b>
1003 3000 Dr. bondy car sandy 310 Marine Ave 654564 sandy city 90710 LOS ANGELES 70456 BA EN 88888 999991
<b>Thanks In advance
Sandy</b>
Message was edited by:
sandy reborn
loop at itab.
perform bdc_dynpro using 'SAPMF02K' '0108'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-D0110'.
<b>perform bdc_field using 'BDC_OKCODE'
'/00'.</b>
perform bdc_field using 'RF02K-LIFNR'
ITAB-LIFNR.
perform bdc_field using 'RF02K-EKORG'
ITAB-EKORG.
perform bdc_field using 'RF02K-D0110'
'X'.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
<b>perform bdc_field using 'BDC_OKCODE'
'=UPDA'.</b>
perform bdc_field using 'LFA1-ANRED'
ITAB-ANRED.
perform bdc_field using 'LFA1-NAME1'
itab-name1.
perform bdc_field using 'LFA1-SORTL'
ITAB-SORTL.
perform bdc_field using 'LFA1-NAME2'
ITAB-NAME2.
perform bdc_field using 'LFA1-STRAS'
ITAB-STRAS.
perform bdc_field using 'LFA1-PFACH'
ITAB-PFACH.
perform bdc_field using 'LFA1-ORT01'
ITAB-ORT01.
perform bdc_field using 'LFA1-PSTLZ'
ITAB-PSTLZ.
perform bdc_field using 'LFA1-ORT02'
ITAB-ORT02.
perform bdc_field using 'LFA1-PSTL2'
ITAB-PSTL2.
perform bdc_field using 'LFA1-LAND1'
ITAB-LAND1.
perform bdc_field using 'LFA1-SPRAS'
ITAB-SPRAS.
perform bdc_field using 'LFA1-TELX1'
itab-telx1.
perform bdc_field using 'LFA1-TELF1'
itab-telF1.
BDC Ok codes should be at lost unlike which come from recording
try this and come back
regards,
pavan
Similar Messages
-
BDC Upload Vendor email address
Hi experts,
Could you tell me how I can upload the vendor email address information with BDC.
Best regards.
Tks a million!
David.Hi
Use the transaction code MK02 to change the vendor details. For that first you have to do the recording in SHDB. Then generate a program from the recording and then pass your values to it.
Regards,
Vishwa. -
BDC program to change to vendor master
Can anyone give me a sample BDC code to change vendor master MK02
After entering the Vendor number and selecting the checkboxes Address and Control in the first screen if i take enter it should go to the second screen which contains all fields of address to modify but My code is giving the screen 0110 which contains only few fields,even though i prepared BDC table with 0111 screen, but the actual screen to be called is 0111.
Can anyone send the sample code or give me the solution
Thanks,DATA : lv_filename TYPE STRING,
V_TEXTOUT TYPE T100-TEXT,
v_tcode TYPE tcode.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA: MESSTAB TYPE STANDARD TABLE OF BDCMSGCOLL ,
MESSTAB1 TYPE BDCMSGCOLL.
DATA : ITAB_FILETAB TYPE FILETABLE.
CONSTANTS: C_TCODE(4) TYPE C VALUE 'AS02', " Assets master data Change - Transaction
C_N TYPE C VALUE 'N', " Not to display screens while call transaction
C_E TYPE C VALUE 'E', " Error
C_S TYPE C VALUE 'S'.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : P_FILE TYPE STRING OBLIGATORY,
P_APPL TYPE FILENAME-FILEEXTERN DEFAULT '/usr/sap/tmp/test_asset.txt' OBLIGATORY LOWER CASE,
P_ALV TYPE C AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM GET_FILENAME_UPLOAD_FILE.
AT SELECTION-SCREEN ON P_FILE.
PERFORM CHECK_FILE_EXISTS.
START-OF-SELECTION.
PERFORM READ_FILE .
PERFORM FILL_TAB.
PERFORM GET_FINAL_RECORD.
PERFORM BDC_REC.
FORM CHECK_FILE_EXISTS.
DATA: V_FILENAME TYPE STRING,
V_RET TYPE C.
V_FILENAME = P_FILE .
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE = V_FILENAME
RECEIVING
RESULT = V_RET
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
OTHERS = 5.
IF NOT ( SY-SUBRC = 0 AND V_RET = 'X' ).
MESSAGE E000(100) WITH 'file does not exits '.
ENDIF.
ENDFORM.
*& Form GET_FILENAME_UPLOAD_FILE
select the file on presentation server using F4 option.
FORM GET_FILENAME_UPLOAD_FILE.
DATA: V_TITLE TYPE STRING,
V_RC TYPE I.
V_TITLE = 'WINDOW ' .
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = V_TITLE
DEFAULT_FILENAME = '*.txt'
INITIAL_DIRECTORY = 'C:\'
MULTISELECTION = ' ' "No multiple selection
CHANGING
FILE_TABLE = ITAB_FILETAB
RC = V_RC.
READ TABLE ITAB_FILETAB INTO P_file INDEX 1.
ENDFORM.
FORM READ_FILE .
lv_filename = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = lv_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
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 = ITAB_FILE
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.
ENDFORM.
FORM BDC_REC .
DATA user_date TYPE sy-datum.
DATA : DATE_FORMAT(10) TYPE C,
TEMP(2) TYPE C,
ROW TYPE STRING ,
ROW1 TYPE STRING.
LOOP at ITAB_FINAL INTO WA_FINAL .
CONCATENATE WA_FINAL-afabg6(4) WA_FINAL-afabg0(2) WA_FINAL-afabg+3(2) INTO USER_DATE .
WRITE USER_DATE TO DATE_FORMAT.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'ANLA-ANLN1'
WA_FINAL-ANLN1 . "'158'.
PERFORM BDC_FIELD USING 'ANLA-ANLN2'
WA_FINAL-ANLN2 . "'0'.
PERFORM BDC_FIELD USING 'ANLA-BUKRS'
WA_FINAL-BUKRS . "'2600'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB08'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-TXT50'.
PERFORM BDC_FIELD USING 'ANLA-TXT50'
'PUMP/ATTACK REAGENT METERING'.
PERFORM BDC_FIELD USING 'ANLH-ANLHTXT'
'PUMP/ATTACK REAGENT METERING'.
PERFORM BDC_FIELD USING 'ANLA-INVNR'
'DB1LA607251CNWF'.
PERFORM BDC_FIELD USING 'ANLA-MENGE'
'1'.
PERFORM BDC_FIELD USING 'ANLA-MEINS'
'EA'.
PERFORM BDC_FIELD USING 'ANLA-INKEN'
'X'.
PERFORM BDC_FIELD USING 'ANLA-AKTIV'
'07/01/1984'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BUCH'.
CLEAR TEMP.
*TEMP = WA_FINAL-LINENO.
CONCATENATE 'ANLB-WBIND(' WA_FINAL-LINENO ')' INTO ROW1 .
PERFORM BDC_FIELD USING 'BDC_CURSOR'
ROW1 ."'ANLB-WBIND(06)'.
CONCATENATE 'ANLB-AFABG(' WA_FINAL-LINENO ')' INTO row.
PERFORM BDC_FIELD USING row
DATE_FORMAT . "wa_file-afabg . "'12/01/1985'.
CALL TRANSACTION C_TCODE USING BDCDATA
MODE C_N
UPDATE C_S
MESSAGES INTO MESSTAB.
IF SY-SUBRC EQ 0.
READ TABLE MESSTAB INTO MESSTAB1 WITH KEY MSGTYP = C_S.
IF SY-SUBRC EQ 0.
Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = MESSTAB1-MSGID
MSGNR = MESSTAB1-MSGNR
MSGV1 = MESSTAB1-MSGV1
MSGV2 = MESSTAB1-MSGV2
MSGV3 = MESSTAB1-MSGV3
MSGV4 = MESSTAB1-MSGV4
IMPORTING
MESSAGE_TEXT_OUTPUT = V_TEXTOUT.
Build Success table ready for output
MOVE-CORRESPONDING WA_FINAL TO WA_SUCCESS.
WA_SUCCESS-MESS = V_TEXTOUT.
APPEND WA_SUCCESS TO ITAB_SUCCESS.
CLEAR: WA_SUCCESS .
ENDIF.
ELSE.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. -
Error when marking return vendor in MK02 ( field LFM1-KZRET )
Hi experts ,
I am doing BDC to update vendor purchasing records ( MK02 ) but it is giving me the following error.
'It is not possible to copy data from field Returns with Shipping Proc. '.
Can anyone help me on this or suggest an alternative.
Best Regards,
Navin Fernandes.Hi
The following are common reasons for BDC error sessions:
■ Posting periods are locked
■ C hanges in master data, e.g., in general ledger (G/L) accounts, profi t centers are locked for posting
■ Changes in screen layout of SAP program
These scenarios are only examples; there may be several reasons for errors. To process incorrect BDC sessions, you need to fi nd out the reasons for these error sessions. The easiest way to do this is to analyze the BDC log. In transaction code
SM35, select the BDC sessions in question and click on the log. The Batch input: Log Overview screen will appear; double-click on any of the rows of the Log Overview tab to see an error screen. After analyzing the error, fi x it and process the BDC
sessions.
Regards from Pakistan -
BDC for deleting vendors at plant level
Hi experts..
I have query regarding BDC. Please read below.
Go to MK02 T-code , select valid combination of vendor and purchase organiation -> select 2 check boxes in general data
-> select 2 check boxes in purchase oraganization data -> press ' Enter ' -> again press ' Enter '-> again press 'Enter '-> select ' Alternative Data ' in Tool bar -> There you will see all the plant descriptions belongs to vendor under purchase oraganization .
Now i have to delete some plants ( based on certain condition ) here,this i can do by selecting plant and press delete line .
This procedure i have to repeat many vendors. i wanted to implement this through BDC .
My question is , through BDC how can i select some plant descriptions ( there in the last screen ) . Dynamically i have to select some plant descriptions .
Thanks much !!!
RadhikaHello dear Srinivas,
I want to inform you that your question is not in the most appropriated spot for the experts. It is related to FI area but was posted in the logistic area.
Please close this thread and open a new one in the following spot (ERP FI)
-SAP ERP Financials
Best Regards,
Christian Rosa -
Email id input field not appearing in MK02 while doing recording in SHDB
Hello All,
I am doing a BDC recording for MK02.It is not displaying the email id input field present in the contact persons section.Please let me know a solution.We are on ECC 6.
Thanks,
Rakesh.Hi
Please tick 'Not a batch input session' in Recording Parameters while recording using SHDB.
Regards
Sathar
Edited by: Sathar RA on Apr 3, 2009 11:25 AM -
urgent
any body out there - I would like to create vendors via MK01 (with a bdc).
I manage to create the vendors but the e-mail field does not populate. If I view the vendor via mk03 the field does not display. I checked tables adrc/adr6 and lfa1 - no email adress - but on lfa1 there is a unique adrnr.
If I go to MK02 and update the email manually it does display on MK03 and also on ADR6
can somebody please help me - please please pleaseYour first screen should look like:
'X' 'SAPMF02K' '0107', "Create Vendor: Initial Screen
' ' 'RF02K-BUKRS' 'CCCC',
' ' 'RF02K-KTOKK' 'ACGP',
' ' 'USE_ZAV' 'X'. " <====
Rob -
Hi ABAPER's,
This is Sekhar. I have a idea can we creat and modify vendor data using transactions MK01, MK02 by using BDC.
Kindly send me an option.
waiting for ur responce.
beyHi,
Using MK01 and MK02, you can create and change vendors only for the general and purchase org view. You wont be able to create vendors in company code view. If this suits your requriement you can go ahead with MK01 and MK02 . If you have to create even for company code view, you can use the generic transactions XK01 and XK02
Vikranth -
Error while running a BDC for the Transaction F-02
Hi,
I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
How to solve this issue?.
Waiting for ur replies.........
Regards
N.SenthilHi,
When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
Refer below theard for sample bdc code for f-02.
https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
Regards -
Unable to update the serial number through bdc in Sales Order
Hi experts,
I written the inboud FM for to update the 3rd party items serial number to the sales orders through BDC Call transaction Method.
Here i am facing a problem when i have the 19 item Quan ,it is updating correct through idoc , when ever there is moe than 19 and at that if any serial number repeated for that if i am changing at that time it is loosing the control of the BDC and giving the control to the salesorder screen.
how can i handle that control again has to come to BDC prgrm......
Thnks,
Regards,
BharaniHi,
Can you please let me know the segment in ORDERS05 Idoc to process the Payment card information and if the standard Function Module can handle the creation of a Sales Order with data for Payment Card.
We have a requirement to map the Tokenized Number of the Credit Card send from a store front end to ECC mapping via SAP-PI.
Thanks in Advance, -
MULTIPLE ITEM PROBLEM IN VL31N BDC
hI FRIENDS ,
I AM POSTING A BDC OF TRANSACTION VL31N ,ie FOR SCHEDULE AGREEMENT INBOUND DELIVERY.I CREATE A FUNCTIONAL MODULE OF THE SAME AND CALL IT FROM AN ASP PAGE,IN THAT THERE IS PO NUMBER 5500000986 WHICH HAS TWO ITEMES 62 AND 95 RESPECTIVLY OF SAME MATARIAL NUMBER R010230123041002 AND DIE NUMBER 2304P,NOW THE PROBLEM IS THIS BDC IS WORKING WHEN THERE IS ONLY ONE ITEM BUT GIVES AN ERROR "CANT CREAT INBOUND DELIVERY FOR PO NO ...' WNEN IT HAS MULTIPLE ITEM.WHAT SHOULD I DO ? I ALSO USED LOOP BUT IT ALSO DOSENT WORK AS IT WILL ADD ALL OPEN QTY OF PO 986 AND UPDATE AGAINST ITEM NO 95.
CODE IS AS FOLLOWS:.........
FUNCTION y_synie_bdcinbdly.
""Local interface:
*" IMPORTING
*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
*" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
*" VALUE(USER) LIKE APQI-USERID OPTIONAL
*" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
*" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
*" VALUE(EXTNID) LIKE MAKT-MAKTG
*" VALUE(VENDORNO) LIKE LFA1-LIFNR
*" VALUE(PONUMBER) LIKE EKKO-EBELN
*" VALUE(ITEMNUMBER) LIKE LIPS-VGPOS
*" VALUE(MATERIAL) LIKE MAKT-MAKTG
*" VALUE(DLYQTY) LIKE LIPS-LFIMG
*" VALUE(BTCHNO) LIKE LIPS-CHARG
*" VALUE(POSLR) LIKE EKES-EBELP OPTIONAL
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" VALUE(INDELYNO) LIKE SY-MSGV2
*" VALUE(MSG1) LIKE SY-MSGV1
*" VALUE(MSG2) LIKE SY-MSGV2
*" VALUE(MSG3) LIKE SY-MSGV3
*" VALUE(MSG4) LIKE SY-MSGV4
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL
*" ERRTAB STRUCTURE YSYNERRMSGS
*" INDLYTAB STRUCTURE YSYN_QTYTAB
Updated by ANAND SYNISE 19.1.2007
DATA: BEGIN OF bdctab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdctab.
DATA: datenow(10) TYPE c,
fldvar(30) TYPE c,
fldno TYPE i,
flditoc(6) TYPE c,
qty(13) TYPE c.
DATA maxposnr LIKE lips-posnr.
DATA testposnr TYPE posnr.
DATA itemnoint TYPE i.
CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO datenow.
CLEAR bdctab.
REFRESH bdctab.
PERFORM open_group USING group user keep holddate ctu.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '4007'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-VERUR_LA'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-LIFNR'.
bdctab-fval = vendorno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LV50C-BSTNR'.
bdctab-fval = ponumber.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-VERUR_LA'.
bdctab-fval = extnid.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=MKAL_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIKP-BLDAT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POPO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '0111'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'RV50A-PO_MATNR'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = 'WEIT'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-PO_MATNR'.
bdctab-fval = material.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=POLO_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-POSNR(01)'.
APPEND bdctab.
*ADDED BY ANAND ON 22-01-2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = ITEMNUMBER . "ITEMNUMBER = LIPS-VGPOS
APPEND bdctab.
************ENDED***********************
ADDED BY MILIND 19.01.2007
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = poslr .
APPEND bdctab.
* ENDED * *
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LIPS_SELKZ(01)'.
bdctab-fval = ''.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '/00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-CHARG(01)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
QTY = INDLYTAB-DLYQTY.
qty = dlyqty.
bdctab-fnam = 'LIPSD-G_LFIMG(01)'.
bdctab-fval = QTY.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIPS-CHARG(01)'.
* BDCTAB-FVAL = INDLYTAB-BTCHNO.
bdctab-fval = btchno.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-program = 'SAPMV50A'.
bdctab-dynpro = '1000'.
bdctab-dynbegin = 'X'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_OKCODE'.
bdctab-fval = '=SICH_T'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'LIKP-BLDAT'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_CURSOR'.
bdctab-fval = 'LIPS-MATNR(02)'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFDAT_LA'.
bdctab-fval = datenow.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'RV50A-LFUHR_LA'.
bdctab-fval = '00:00'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CLEAR bdctab.
bdctab-fnam = 'BDC_SUBSCR'.
bdctab-fval = 'SAPMV50A'.
APPEND bdctab.
CALL TRANSACTION 'VL31N' USING bdctab MODE 'N' MESSAGES INTO messtab.
subrc = sy-subrc.
PERFORM close_group USING ctu.
CLEAR bdctab.
REFRESH bdctab.
IF sy-subrc EQ 0.
indelyno = sy-msgv2.
ENDIF.
LOOP AT messtab.
MOVE: messtab-msgid TO errtab-msgid,
messtab-msgnr TO errtab-msgnr,
messtab-msgv1 TO errtab-msg1,
messtab-msgv2 TO errtab-msg2,
messtab-msgv3 TO errtab-msg3,
messtab-msgv4 TO errtab-msg4.
APPEND ERRtab.
ENDLOOP.
LOOP AT errtab.
SELECT SINGLE text FROM t100
INTO errtab-errmsg
WHERE msgnr EQ errtab-msgnr AND arbgb EQ errtab-msgid
AND sprsl EQ sy-langu.
MODIFY errtab.
ENDLOOP.
ENDFUNCTION.Hi,
Check this code:
REPORT Z_CUSTOMER_UPLOAD .
D A T A D E C L A R A T I O N S *
DATA:BEGIN OF IT_CUSTOMER OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_CUSTOMER.
DATA:BEGIN OF IT_success OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_success.
DATA:BEGIN OF IT_error OCCURS 0,
KUNNR LIKE MV10A-KUNNR,
VKORG LIKE MV10A-VKORG,
VTWEG LIKE MV10A-VTWEG,
MATNR LIKE MV10A-MATNR,
KDMAT LIKE MV10A-KDMAT,
MEGRU LIKE MV10A-MEGRU,
SELKZ TYPE C value 'X',
LPRIO LIKE MV10A-LPRIO,
ANTLF LIKE MV10A-ANTLF,
END OF IT_error.
DATA: L_INDEX TYPE SY-TABIX.
DATA:IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
ERROR MESSAGE TABLE
DATA:IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : C_S TYPE C VALUE 'S',
C_E TYPE C VALUE 'E'.
*DATA: IT_SUCCESS LIKE IT_CUSTOMER OCCURS 0,
IT_ERROR LIKE IT_CUSTOMER OCCURS 0.
DATA : V_RECTOT TYPE I,
V_RECERR TYPE I,
V_RECSUC TYPE I.
S E L E C T I O N - S C R E E N *
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_FILE LIKE RLGRAP-FILENAME .
SELECTION-SCREEN : END OF BLOCK B1.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
to get F4 help for p_file
PERFORM F4_FILENAME USING P_FILE.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Uploading data from flat file into it_tab
PERFORM BDC_UPLOAD USING P_FILE.
PERFORM PROCESS_DATA.
PERFORM POPULATE_BDC.
E N D O F S E L E C T I O N *
*END-OF-SELECTION.
PERFORM DISPLAY_REPORT.
*& Form F4_FILENAME
text
-->P_P_FILE text
FORM F4_FILENAME USING P_P_FILE.
DATA:L_FILE TYPE IBIPPARMS-PATH.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE .
P_P_FILE = L_FILE.
ENDFORM. " F4_FILENAME
*& Form BDC_UPLOAD
text
-->P_P_FILE text
FORM BDC_UPLOAD USING P_P_FILE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 8
I_END_ROW = 1000
TABLES
INTERN = IT_DATA
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " BDC_UPLOAD
*& Form PROCESS_DATA
text
--> p1 text
<-- p2 text
FORM PROCESS_DATA.
SORT IT_DATA BY ROW COL.
LOOP AT IT_DATA.
CASE IT_DATA-COL.
WHEN 1.
IT_CUSTOMER-KUNNR = IT_DATA-VALUE.
WHEN 2.
IT_CUSTOMER-VKORG = IT_DATA-VALUE.
WHEN 3.
IT_CUSTOMER-VTWEG = IT_DATA-VALUE.
WHEN 4.
IT_CUSTOMER-MATNR = IT_DATA-VALUE.
WHEN 5.
IT_CUSTOMER-KDMAT = IT_DATA-VALUE.
WHEN 6.
IT_CUSTOMER-MEGRU = IT_DATA-VALUE.
WHEN 7.
IT_CUSTOMER-LPRIO = IT_DATA-VALUE.
WHEN 8.
IT_CUSTOMER-ANTLF = IT_DATA-VALUE.
APPEND IT_CUSTOMER.
ENDCASE.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form POPULATE_BDC
text
--> p1 text
<-- p2 text
FORM POPULATE_BDC.
DATA:L_COUNTER TYPE N,
L_STRING TYPE STRING.
LOOP AT IT_CUSTOMER.
AT NEW KUNNR.
CLEAR L_COUNTER.
L_INDEX = SY-TABIX.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_dynpro using 'SAPMV10A' '0100'.
perform bdc_field using 'MV10A-KUNNR'
IT_CUSTOMER-KUNNR.
perform bdc_field using 'MV10A-VKORG'
IT_CUSTOMER-VKORG.
perform bdc_field using 'MV10A-VTWEG'
IT_CUSTOMER-VTWEG.
perform bdc_field using 'BDC_OKCODE'
'/00'.
ENDAT.
L_COUNTER = L_COUNTER + 1.
CLEAR L_STRING.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-MATNR(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MATNR.
CONCATENATE 'MV10A-KDMAT(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-KDMAT.
CONCATENATE 'MV10A-MEGRU(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-MEGRU.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*-- For Page down in Call Transaction Mode
IF L_COUNTER = 14.
CLEAR L_COUNTER.
PERFORM BDC_DYNPRO USING 'SAPMV45A' '4001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
ENDIF.
perform bdc_dynpro using 'SAPMV10A' '0200'.
CONCATENATE 'MV10A-SELKZ(' L_COUNTER ')' INTO L_STRING.
perform bdc_field using L_STRING
IT_CUSTOMER-SELKZ.
perform bdc_field using 'BDC_OKCODE'
'=SELE'.
perform bdc_dynpro using 'SAPMV10A' '0300'.
perform bdc_field using 'MV10A-KDMAT'
IT_CUSTOMER-KDMAT.
perform bdc_field using 'MV10A-LPRIO'
IT_CUSTOMER-LPRIO.
perform bdc_field using 'MV10A-ANTLF'
IT_CUSTOMER-ANTLF.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'.
at end of kunnr.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'VD51' USING IT_BDC MODE 'A' UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
CLEAR IT_BDC.
REFRESH IT_BDC.
ENDAT.
IF NOT IT_MESSAGES[] IS INITIAL.
PERFORM FORMAT_MESSAGE.
ENDIF.
ENDLOOP.
ENDFORM. " POPULATE_BDC
*& Form bdc_dynpro
text
-->P_0273 text
-->P_0274 text
FORM bdc_dynpro USING VALUE(P_0273)
VALUE(P_0274).
IT_BDC-PROGRAM = P_0273.
IT_BDC-DYNPRO = P_0274.
IT_BDC-DYNBEGIN = 'X'.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0278 text
-->P_RECORD_KUNNR_001 text
FORM bdc_field USING VALUE(P_0278)
VALUE(P_0279).
IT_BDC-FNAM = P_0278.
IT_BDC-FVAL = P_0279.
APPEND IT_BDC.
CLEAR IT_BDC.
ENDFORM. " bdc_field
*& Form FORMAT_MESSAGE
text
--> p1 text
<-- p2 text
FORM FORMAT_MESSAGE.
DATA: L_MSG(100).
LOOP AT IT_MESSAGES.
READ TABLE IT_CUSTOMER INDEX L_INDEX.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = IT_MESSAGES-MSGID
LANG = SY-LANGU
NO = IT_MESSAGES-MSGNR
V1 = IT_MESSAGES-MSGV1
V2 = IT_MESSAGES-MSGV2
V3 = IT_MESSAGES-MSGV3
V4 = IT_MESSAGES-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write:/ l_msg.
ENDLOOP.
ENDFORM. " FORMAT_MESSAGE
reward if helpful,
keerthi -
Creation of PGI using BDC for tc VL02N is not happening..
Hi All,
i need to do Post Goods Issue (PGI) thro' BDC and after that i need to update the flag in Ztable.
its giving Success message and updating the database also.
but its not issuing the PGI.and further i want to create billing doc.So its compulsory to me to post PGI.
if i look into the BDCMSGCOLL structure its giving "NO BATCH INPUT DATA FOR SCREEN"? why this is happening?
please let me know immediately....
REFRESH: tt_bdcmsgcoll .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_created-document_numb
IMPORTING
output = wa_created-document_numb.
REFRESH tt_bdcdata.
PERFORM bdc_dynpro USING text-001 text-002.
PERFORM bdc_field USING text-008
text-014.
PERFORM bdc_field USING text-009
text-011.
PERFORM bdc_field USING text-014
wa_created-document_numb.
PERFORM bdc_dynpro USING text-001 text-003.
PERFORM bdc_field USING text-009
text-036.
PERFORM bdc_field USING text-025
sy-datum.
PERFORM bdc_field USING text-008
text-035.
PERFORM bdc_field USING text-037
sy-datum.
PERFORM bdc_field USING text-038
text-029.
PERFORM bdc_field USING text-016
c_x.
CALL TRANSACTION c_t_del USING tt_bdcdata
MODE c_m
UPDATE c_u
MESSAGES INTO tt_bdcmsgcoll .
SORT tt_bdcmsgcoll BY msgtyp.
READ TABLE tt_bdcmsgcoll INTO wa_bdcmsgcoll WITH KEY msgtyp = c_e.
IF sy-subrc EQ 0.
LOOP AT tt_bdcmsgcoll INTO wa_bdcmsgcoll WHERE msgtyp = c_e.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = wa_bdcmsgcoll-msgid
lang = text-010
no = wa_bdcmsgcoll-msgnr
v1 = wa_bdcmsgcoll-msgv1
v2 = wa_bdcmsgcoll-msgv2
v3 = wa_bdcmsgcoll-msgv3
v4 = wa_bdcmsgcoll-msgv4
IMPORTING
msg = v_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
WRITE :/ v_msg.
ENDLOOP.
ELSE.
MOVE : c_x TO wa_worklist-pgi_flag.
READ TABLE tt_epit INTO wa_epit WITH KEY epi_id = wa_worklist-epi_id epi_sr = wa_worklist-epi_sr.
IF sy-subrc EQ 0.
MODIFY tt_epit FROM wa_worklist TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND epi_sr = wa_worklist-epi_sr.
ELSE.
APPEND wa_worklist TO tt_epit.
ENDIF.
wa_epit-pgi_flag = c_x.
MODIFY tt_epit FROM wa_epit TRANSPORTING pgi_flag WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
UPDATE zsd_dt_epit SET pgi_flag = 'X' WHERE epi_id = wa_worklist-epi_id AND del_no = wa_created-document_numb .
IF sy-subrc EQ 0.
ENDIF.
ENDIF.HI,
Please refer this
To perform Post goods issue
PERFORM OPEN_GROUP.
PERFORM BDC_DYNPRO USING 'SAPMV50A' '4004'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LIKP-VBELN'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=WABU_T'.
PERFORM BDC_FIELD USING 'LIKP-VBELN' DELIVERY.
'84000064'.
PERFORM BDC_TRANSACTION USING 'VL02N'.
PERFORM CLOSE_GROUP.
CLEAR : DELIVERY,
T_BSITEM,
T_BSICTL.
ENDIF.
ENDFORM. " DELIVERY -
Problem in creation of BDC for transaction phap_create
Hello Friends,
I am trying to create BDC for PHAP_CREATE.
When you run a transaction a pop up window appears to select the template id.
And in BDC it is selected by cursor position. So once selected, the value of template id cannot be changed.
I want this as a parameter.So that each time I run a BDC I will be able to create different types of Appraisal documents i.e with different template ids.
How to go about it???
Regards,
BhushanHi,
For selecting the id, while doing recording,
record with
CTRL + F ( Where u can give ur id) and proceed further. -
Dear Experts,
I have a module pool program and transaction for shipping advice, where I have given a option that if user enters Sales Order in the selection screen and in the next screen it shows all the related infromation of that order and if needed user can edit few fields in this screen and can take print.
Now for the same report I dont want to show any screen to user after user enters the order and executes directly it should display the dialog box for 'Print' and 'Print Preview'.
I did BDC recording for the transaction of shipping adive report and with that code I have developed other program and if run this program in foreground (Mode "A")it will show all screens with that dialog screen for 'Print' also but if I run in background (Mode "B") it will not show any screen and it will print the document directly.
Now my requirement is I have to show only dialog screen for 'Print' & 'Print Preview'.
Please give me your valuable Ideas on how to achieve this...
Thanks in advance.
Best Regards
VenkatHello,
May be you are not using the full recording or might have some mistake(s) is going on in the completion of recording that is why it is creating problem. And also please check the call transaction code in the BDC program, whether you are performing the accurate t-code with that or not and also perform BDC functions also. If it is right than it would not might have any problem regarding the required output as you want.
Thanks & Regards,
Akg -
What is the Tcodes for Uploading of data using BDC & CATT
PP members:
I was going through the <b>cutover activities</b> , and what I understood is we transfer all the legacy system data into SAP before going live
The data upload follows certain steps (depends on the organizational design load strategies)
First we upload all the master data ( material master, BOM, W/C's & Routings)
Then the transaction data ( Ideally speaking, there should no open orders i.e. WIP as on the day of cutoff )
If the WIP (Work in Process) is unavoidable then the materials consumed shall be treated as <b>materials of the previous stage</b> and necessary adjustments shall be made after cutover day
At this point, I could not able to understand what does the author mean <b>materials of the previous stage</b>
Now comming to the uploading of data into SAP from legacy system, we use tools like LSMW, CATT & BDC
Is it a must to use <b>only LSMW tool</b> to upload master data or any other upload tools are fine
Lastly,. I am not sure about the Tcode of CATT & BDC
Summary of the questions:
1.What does the author mean <b>material of previous stage</b>, for WIP materials during cutover activities
2. Is it mandatory to use only LSMW tool for uploading for master data
3. What are the Tcodes for upload tools CATT & BDC ?
Thanks for your time
Suren RDear,
1.What does the author mean material of previous stage, for WIP materials during cutover activities - as i understood, what is the stage of material..like it must have gone through 2 work centers and other 2 is left. i.e. you need to create Production order with only 2 operation as other 2 is already over. - usually it is done in such a way that we will create Production order and confirm till 2 operations and WIp is calculated so thatb FI will tally the books in SAP and lagacy.
2. Is it mandatory to use only LSMW tool for uploading for master data - no you can use any tool as required and suits yr requirement
3. What are the Tcodes for upload tools CATT & BDC- BDC through a prog in SE38. CATT through - SCEM.
Maybe you are looking for
-
How to restrict access to portal based on entitlements.
Hi, I am working on weblogic 8.1 portal project. i want to restrict the user to access the portal based on the entitlements. However when user try to login he is seeing Weblogic Error 403 forbidden page. How to display custom error page, instead of w
-
How do I forward a message to another contact or email it?
-
Okay, so I noticed my lightroom was on 240 PPI resolution. I changed it to 300 because I read 300 was for standard prints. What would I need to set the export to in the resolution box for a very large Canvas? Is it better to choose Tiff instead of Jp
-
Yosemite is junk - DO NOT UPGRADE
My beloved Macbook has become like a Windows machine - memory leaks, freezes, weird pastel UI colors, my Canon Digital SLR will not mount, Bad move Apple. I am very ****** off. Test you stuff before you release it. How do we go back to Mavericks?
-
I installed the latest version of iTunes and now everytime I try to open it, a notification pops up that says "the itunes library cannot be found or created" what do I do?