Reg Vendor master upload using BDC Call Transaction Method
Hi All,
Thanks in advance.
I am uploading vendor master data using bdc call transaction method for XK01. In that i am getting an error message that the fields " smtp_addr" ( for email) and "time_zone" (for time zone) doesnot exist on the screen '0110' ( this is the second screen) . the field timezone will be displayed on the screen only when we go for communications button and select the URL field .
Do anybody have the solution for this problem. if possible can you give me the code for that screen.
Create a recording via SM35 (menu go to=>recording), this will generate automatically the code for filling your bdcdata-table...
Similar Messages
-
Error in BDC CALL TRANSACTION METHOD..
hai i got an error in doing BDC CALL TRANSACTION METHOD
Error:diffrent number of parameters in FORM and PERFORM(routine :FILL_SCREEN_DETAILS:,number of formal parameters :3,number of actual parameters:1)
PROGRAM
REPORT ZDEMO_UPLOAD_COST_CENTER_DATA.
DATA:BEGIN OF WA_DATA,
KOKRS TYPE KOKRS,"CONTROLLING AREA
KOSTL TYPE KOSTL,"COST CENTER
DATAB TYPE DATAB,"START DATE
DATBI TYPE DATBI,"END DATE
KTEXT TYPE KTEXT,"NAME
LTEXT TYPE LTEXT,"DESCRIPTION
VERAK TYPE VERAK,"PERSON RESPONSIBLE
KOSAR TYPE KOSAR, "COST CENTER CATEGORY
KHINR TYPE KHINR,"HIERARCHY AREA
BUKRS TYPE BUKRS,"COMPANY CODE
GSBER TYPE GSBER,"BUISINESS AREA
END OF WA_DATA.
*TYPES:IT_DATA TYPE STANDARD TABLE OF TY_DATA.
DATA:IT_DATA LIKE TABLE OF WA_DATA,
IT_BDCDATA LIKE TABLE OF BDCDATA,
WA_BDCDATA LIKE LINE OF IT_BDCDATA,
IT_BDCMSGCOLL LIKE TABLE OF BDCMSGCOLL,
WA_BDCMSGCOLL LIKE LINE OF IT_BDCMSGCOLL.
DATA :V_FILE TYPE STRING.
CONSTANTS :C_KS01(4) TYPE C VALUE 'KS01',
C_X(1) TYPE C VALUE 'X',
C_A(1) TYPE C VALUE 'A'.
SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
PARAMETER :PA_FILE LIKE FC03TAB-PL00_FILE OBLIGATORY.
SELECTION-SCREEN:END OF BLOCK B1.
*AT SELECTION SCREEN ON VALUE REQUEST
* EVENT TO BE TRIGGERED WHEN WE PRESS F4.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_FILE.
PERFORM GET_F4_FOR_FILE USING PA_FILE.
* START-OF-SELECTION
START-OF-SELECTION.
*WE NEED TO MOVE THE PA_FILE INTO ANOTHER VARIABLE OF TYPE STRING
*AS WE ARE GOING TO USE THE SAME IN THE FM:GUI_UPLOAD THERE THE FILE TYPE IS STRING
V_FILE = PA_FILE.
PERFORM UPLOAD_FILE_T0_ITAB USING V_FILE CHANGING IT_DATA.
*FILL THE SCREEN AND FIELD DETAILS
LOOP AT IT_DATA INTO WA_DATA.
REFRESH IT_BDCDATA.
*FIRST SCREEN DETAILS
PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1''0200''X'.
*CURSOR DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_CURSOR''CSKSZ-KOKRS'.
*OK CODE DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_OKCODE''/00'.
*CONTROLLING AREA
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KOKRS' WA_DATA-KOKRS.
*COST CENTER DETAILS
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KOSTL' WA_DATA-KOSTL.
* START DATE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-DATAB_ANFO' WA_DATA-DATAB.
*END DATE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-DATBI_ANFO' WA_DATA-DATBI.
*NEXT SCREEN DETAILS
PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1''0299''X'.
*OKCODE DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_OKCODE''=BU'.
*SUBSCRN FIELD DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_SUBSCR''BDC-SUBSCR'.
*CURSOR DETAILS
PERFORM FILL_FIELD_DETAILS USING 'BDC_CURSOR''CSKSZ-WAERS'.
*NAME
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KTEXT' WA_DATA-KTEXT.
*DESCRIPTION
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-LTEXT' WA_DATA-LTEXT.
*PERSON RESPONSIBLE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-VERAK' WA_DATA-VERAK.
*COST CENTER CATEGORY
PERFORM FILL_FIELD_DETAILS USING'CSKSZ-KOSAR' WA_DATA-KOSAR.
*HIERARCHY AREA
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-KHINR' WA_DATA-KHINR.
*COMPANY CODE
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-BUKRS' WA_DATA-BUKRS.
*BUISINESS AREA
PERFORM FILL_FIELD_DETAILS USING 'CSKSZ-GSBER' WA_DATA-GSBER.
*CALL THE TRANSACTION
CALL TRANSACTION C_KS01 USING IT_BDCDATA
MODE C_A "ALL SCREENS
"N-NO SCREENS
"E-ERROR SCREENS ONLY
UPDATE 'A' "ASYNCHRONOUS
"SYNCHRONOUS
MESSAGES INTO IT_BDCMSGCOLL.
ENDLOOP.
* FORM FILL SCREEN_DETAILS
FORM FILL_SCREEN_DETAILS USING PROGRAM LIKE BDCDATA-PROGRAM
DYNPRO LIKE BDCDATA-DYNPRO
DYNBEGIN LIKE BDCDATA-DYNBEGIN.
CLEAR WA_BDCDATA.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = DYNBEGIN.
APPEND WA_BDCDATA TO IT_BDCDATA.
ENDOFRM.
* FORM FILL_FIELD_DETAILS
FORM FILL_FIELD_DETAILS USING FNAM FVAL.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_BDCDATA.
ENDFORM.
* FORM GETE_F4_FOR_FILE
*DISPLAY ALL THE FILES IN THE SYSTEM FOR SELECTION
*P_PA_FILE NAME OF THE FILE
FORM GET_F4_FOR_FILE USING P_PA_FILE.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
* EXPORTING
* PROGRAM_NAME = SYST-REPID
* DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'PA_FILE'
* STATIC = ' '
* MASK = ' '
CHANGING
FILE_NAME = PA_FILE.
* EXCEPTIONS
* MASK_TOO_LONG = 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.
ENDFORM.
* FORM UPLOAD_FILE_TO_ITAB
* FP_V_FILE = FILE NAME
*FP_IT_DATA = INTERNAL TABLE TO STORE THE DATA
FORM UPLOAD_FILE_TO_ITAB USING FP_V_FILE CHANGING FP_IT_DATA LIKE IT_DATA.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FP_V_FILE
HAS_FIELD_SEPARATOR = ' X'
TABLES
DATA_TAB =FP_IT_DATA.
ENDFORM.
Edited by: saifudheenc on Aug 7, 2010 5:09 PMhi
try to add spaces between parameters :
example:
PERFORM FILL_SCREEN_DETAILS USING 'SAPLKMA1' '0200' 'X'.
regards,darek -
Local mode update in bdc -Call transaction method
what is LOCAL MODE UPDATE in BDC- Call transaction methods ?
Hi,
Try to understand from the below CODE
CALL TRANSACTION 'ZBDCSINGLE' USING IT_BDCDATA MODE 'A' UPDATE 'S' MESSAGES INTO IT_BDCMSGCOLL.
REFRESH IT_BDCDATA.
Cheers!! -
Holder(A008) is not maintaing in HRP1001 (BDC - Call Transaction Method)
Dear Friends,
Holder (A008) in HRP1001 is not maintained for some hiried persons through BDC - Call Transaction Method.
Except Holder update eveything is updated in the hrp1001.
When we hire a perosn through PA40, then its automatically maintaining Holder ( A008 ) in HRP1001. But for the same case through BDC program with Call Transaction method, its not maintaining Holder.
What can be reason behind not updating holder in HRP1001. How we can maintain Holder in this case.
Thanks
Rav
Edited by: Rav Jordan on Jan 10, 2012 8:03 AMHi Keshav,
Thanks for your response.
After running
CALL TRANSACTION 'PA40' USING BDCDATA
MODE CTUMODE " 'A'
UPDATE 'A'
MESSAGES INTO MESSTAB.
if sy-subrc eq '0'.
i am selecting perner created from pa0002.
now to update holder i am using fucntion module.
WA_HOLD-AEDTM = SY-DATUM.
WA_HOLD-UNAME = SY-UNAME.
WA_HOLD-OBJID = P_PLANS.
WA_HOLD-BEGDA = DT.
WA_HOLD-ENDDA = '99991231'.
WA_HOLD-OTYPE = 'S'.
WA_HOLD-PLVAR = '01'.
WA_HOLD-RSIGN = 'A'.
WA_HOLD-RELAT = '008'.
WA_HOLD-SCLAS = 'P'.
WA_HOLD-SOBID = GD_PERNR.
CALL FUNCTION 'RH_INSERT_INFTY'
EXPORTING
FCODE = 'INSE'
VTASK = 'A'
ORDER_FLG = 'X'
COMMIT_FLG = 'X'
AUTHY = 'X'
PPPAR_IMP =
OLD_TABNR = ' '
REPID = ' '
FORM = ' '
KEEP_LUPD =
WORKF_ACTV = 'X'
TABLES
INNNN = WA_HOLD
ILFCODE =
EXCEPTIONS
NO_AUTHORIZATION = 1
ERROR_DURING_INSERT = 2
REPID_FORM_INITIAL = 3
CORR_EXIT = 4
BEGDA_GREATER_ENDDA = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
This also not updating holder in the hrp1001 postion in the table.
May i know where to do change in the code so that holder can be maintained.
Thanks
Rav -
I want in LSMW SAME CODING. THIS IS USING BDC CALL TRANSACTION
REPORT ZXX_BDC_PRA NO STANDARD PAGE HEADING LINE-COUNT 20
LINE-SIZE 150 .
Program Name :ZXX_BDC_PRA *
Object Id : *
Develper Name : praveen *
Start Date : 25.06.07 *
Description : uploading flat file to sap system *
*--structure for Data Uploading.
DATA: BEGIN OF IT_STR ,
VKORG LIKE RF02D-VKORG,
VTWEG LIKE RF02D-VTWEG,
SPART LIKE RF02D-SPART,
KTOKD LIKE RF02D-KTOKD,
NAME1 LIKE KNA1-NAME1,
SORTL LIKE KNA1-SORTL,
ORT01 LIKE KNA1-ORT01,
PSTLZ LIKE KNA1-PSTLZ,
LAND1 LIKE KNA1-LAND1,
SPRAS LIKE KNA1-SPRAS,
END OF IT_STR.
*--Internal Table for Data Uploading.
DATA: ITAB LIKE IT_STR OCCURS 0.
*--Internal Table to sucessfull Records.
DATA: ITAB1 LIKE IT_STR OCCURS 0.
*--Internal Table to Store Error Records.
DATA: ITAB2 LIKE STANDARD TABLE OF IT_STR WITH HEADER LINE.
*--Internal Table for Storing the BDC data.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*--Internal Table for storing the messages.
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA: COUNT TYPE I VALUE 1,
S VALUE 0, E VALUE 0.
Selection screen *
SELECTION-SCREEN BEGIN OF BLOCK b1
WITH FRAME TITLE TEXT-001.
PARAMETERS: P_FILE TYPE IBIPPARMS-PATH.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*functionality to use drill down list
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = P_FILE.
Start-of-selection *
START-OF-SELECTION.
DATA FILENAME TYPE STRING.
FILENAME = P_FILE.
*-- Form to upload flatfile data into the internal table.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
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.
*--Generating the BDC table for the fields of the internal table.
LOOP AT ITAB INTO IT_STR.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0107'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF02D-KTOKD'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RF02D-VKORG'
IT_STR-VKORG.
PERFORM BDC_FIELD USING 'RF02D-VTWEG'
IT_STR-VTWEG.
PERFORM BDC_FIELD USING 'RF02D-SPART'
IT_STR-SPART.
PERFORM BDC_FIELD USING 'RF02D-KTOKD'
IT_STR-KTOKD.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0110'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-SPRAS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'KNA1-NAME1'
IT_STR-NAME1.
PERFORM BDC_FIELD USING 'KNA1-SORTL'
IT_STR-SORTL.
PERFORM BDC_FIELD USING 'KNA1-ORT01'
IT_STR-ORT01.
PERFORM BDC_FIELD USING 'KNA1-PSTLZ'
IT_STR-PSTLZ.
PERFORM BDC_FIELD USING 'KNA1-LAND1'
IT_STR-LAND1.
PERFORM BDC_FIELD USING 'KNA1-SPRAS'
IT_STR-SPRAS.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0120'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-TXJCD'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0125'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-NIELS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0360'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0310'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNVV-BEGRU'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0324'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNVP-PARVW(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
*--Calling the transaction 'Vd01'.
CALL TRANSACTION 'VD01' USING BDCDATA MODE 'N' UPDATE 'S'
MESSAGES INTO MESSTAB.
PERFORM MESSAGES.
REFRESH : BDCDATA, MESSTAB.
ENDLOOP.
END-OF-SELECTION.
*--Populating the Success records internal table.
IF ITAB1[] IS NOT INITIAL.
format color 5.
WRITE: /'SUCCESSFUL RECORDS'.
format color off.
LOOP AT ITAB1 INTO IT_STR.
WRITE:/ IT_STR-VKORG,IT_STR-VTWEG,
IT_STR-SPART,IT_STR-KTOKD,
IT_STR-NAME1,IT_STR-SORTL,
IT_STR-ORT01,
IT_STR-PSTLZ,
IT_STR-LAND1,
IT_STR-SPRAS.
S = S + 1.
ENDLOOP.
REFRESH : ITAB1.
WRITE:/ 'TOTAL RECORDS',S.
ENDIF.
*--Populating the error records internal table.
IF ITAB2[] IS NOT INITIAL.
FORMAT COLOR 3.
WRITE :/ 'ERRORS RECORDS ARE'.
FORMAT COLOR OFF.
LOOP AT ITAB2.
WRITE:/ ITAB2-VKORG,
ITAB2-VTWEG,
ITAB2-SPART,ITAB2-KTOKD,
ITAB2-NAME1,ITAB2-SORTL,
ITAB2-ORT01,
ITAB2-PSTLZ,
ITAB2-LAND1,
ITAB2-SPRAS.
E = E + 1.
ENDLOOP.
REFRESH : ITAB2.
WRITE: / 'TOTAL RECORDS',E.
REFRESH : ITAB2.
ENDIF.
End of Selection *
END-OF-SELECTION.
TOP-OF-PAGE *
TOP-OF-PAGE.
WRITE:/ SY-ULINE.
WRITE:/10 'REPORT ID',21 SY-REPID,35 'USERNAME',46 SY-UNAME,
60 'SYSTEM DATE',70 SY-DATUM,80 'SYSTEM TIME',90 SY-UZEIT,
100 'PAGE NO',108 SY-PAGNO.
WRITE:/ SY-ULINE.
FOrm to Populate the BDC table.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELD
*& Form messages
FORM MESSAGES .
LOOP AT MESSTAB.
IF MESSTAB-MSGTYP = 'I'.
WRITE : / MESSTAB-MSGV1.
ELSEIF
MESSTAB-MSGTYP = 'S'.
INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB1 .
COUNT = COUNT + 1.
WRITE : / MESSTAB-MSGV1.
ELSEIF
MESSTAB-MSGTYP = 'E'.
INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB2.
COUNT = COUNT + 1.
WRITE : / MESSTAB-MSGV1.
ENDIF.
ENDLOOP.
ENDFORM. " messagesHi
Go through the doc and do the same using LSMW
BDC is the way to transfer data by writing a batch input program which can use either session or call transaction method.
LSMW used to transfer data without/less code.
What type of data we transfer using LSMW?
LSMW is best suited for transferring master data.
Actually BDC and LSMW are not comparable at all.
for example LSMW itself can use BDC as a way of mass data transfer.
BDC is a mass data transfer technique via screen logic of existing SAP Data entry transactions. It behaves as if you are manually making thousand of entires into sap system as a background job. And that is probably the reason why BAPI's are preffered over BDC's.
On the other hand LSMW is a tool to facilitate DATA migration from other legacy systems ... It contains step by step procedure for data migration.
Like Managing Data Migration Projects , Creating Source Structures , Mapping Source structures wid Target structures , etc etc
LSMW internally might well be using the following techniqes for data transfer..
1. IDOX
2. Direct Input / BDC
4. BAPI's
LSMW is an encapsulated data transfer tool. It can provide the same functionality as BDC infact much more but when coming to techinical perspective most the parameters are encapulated. To listout some of the differences :
LSMW is basicaly designed for a fuctional consultant who do not do much coding but need to explore the fuctionality while BDC is designed for a technical consultant.
LSMW offers different techinque for migrating data: Direct input ,BAPI,Idoc,Batch input recording. While bdc basically uses recording.
LSMW mapping is done by SAP while in BDC we have to do it explicitly .
LSMW is basically for standard SAP application while bdc basically for customized application.
Coding can be done flexibly in BDC when compared to LSMW
1. Maintain Attributes:
Here you have to choose the second option and you can do the recording how this should work. Then assign the same to the Batch Input Recording name.
2. Maintain Source structure:
Create a structure name
3. Maintain Source field:
In this you have to create a structure same as that of the input file
eg: name
age
4. Maintain structure relations:
This will link the structure to the input file.
5. Maintain field mapping and conversion rules:
Here is the place where you can do coding, depending upon the code you have written or assignment you have done the values will get picked up from the file and get processed.
6. Maintain field mapping and conversion rules:
If you have any fixed values you can define here.
7. Specify files:
Specify the input file path and type.
8. Assign files:
This will assign ur file to the Input file
9. Read Data:
This will read ur data from teh file.
10. Dispaly Read Data:
You can see the uploaded data
11. Convert Data
This will convert the data to the corresponding format for processing
12. Display Converted data:
13. Create batch input session
Here this will create a batch input session for processing
14. Run Batch Input session:
By clicking on the session and process the same you can do teh needfu.
http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
for Long texts Upload
Please take a look at this..
http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm
Reward points for useful Answers
Regards
Anji -
Handling Warning pop up windows in BDC call transaction method
Hi All,
Iam using a BDC to automate the Costing Process i.e. Transaction CK40N using call transaction method. In a particular Screen after i perform the execute action, a warning pop up window appears. Only if I click on OK, the execution continues or else it will not proceed. How to handle this situation in case a warning pop up window appears based on the input which is given? In other words a Dynamic warning message. Thanks in advance....
Regards,
NirmalHello,
U can either use NO_DIALOG or SUPPRESS DIALOG to avaid this,.
Regards,
Vasanth -
Screen no change in BDC call transaction method
Hi experts
Greetings!
I have a BDC created in call transaction method for t-code FB01.
Data passed successfully to the first screen but when it navigates to the second screen I am not able to pass any data.
After debugging I found that the issue was because of the DYNPRO value.
It was 8500 when I created this recording but now the screen number shows 350.
Is is possible that screen nos change because of any support stack or OSS notes implementation.
In run time i tried to change the value to 350 and it works fine..
Thanks
JayHi,
LSMW Direct input method is better for your quiry. Becasuse i wrote BDC for FB01 but not working properly.
So i used LSMW, helped me a lot. Progmra name is RFBIBL00. Or else i will export and send you if you want. It can handle multiple line items upto 950.
Thanks,
Sriram -
How can we update mk01 with BDC call transaction method
can any one send the sample code for upload of MK01 using call transaction method.
its urgent..Use the following code.
*& Report ZMK01_VA01 *
REPORT Z_MK01 .
SOURCE INTERNAL TABLE
DATA: BEGIN OF T_SOURCE OCCURS 0,
LIFNR TYPE LIFNR,
EKORG TYPE EKORG,
KTOKK TYPE KTOKK,
NAME1 TYPE NAME1,
SORTL TYPE SORTL,
LAND1 TYPE LAND1,
WAERS TYPE WAERS,
END OF T_SOURCE.
*DATA: E_MESSAGE TYPE C.
ERROR MESSAGE TABLE
DATA: T_ERRORMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
TARGET TABLE LIKE BDCDATA
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
TO UPLOAD DATA FROM LEGACY SYSTEM
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'D:\MK01.TXT'
FILETYPE = 'DAT'
IMPORTING
FILELENGTH =
TABLES
data_tab = T_SOURCE
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
NO_AUTHORITY = 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.
TRANSFERING DATA FROM INTERNAL SOURCE TABLE TO TARGET TABLE
LOOP AT T_SOURCE.
REFRESH BDCDATA.
perform bdc_dynpro using 'SAPMF02K' '0107'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
T_SOURCE-LIFNR.
perform bdc_field using 'RF02K-EKORG'
T_SOURCE-EKORG.
perform bdc_field using 'RF02K-KTOKK'
T_SOURCE-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
T_SOURCE-NAME1.
perform bdc_field using 'LFA1-SORTL'
T_SOURCE-SORTL.
perform bdc_field using 'LFA1-LAND1'
T_SOURCE-LAND1.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
T_SOURCE-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'MK01' USING BDCDATA MODE 'A' MESSAGES INTO T_ERRORMSG.
ENDLOOP.
LOOP AT T_ERRORMSG.
WRITE:/ 'MESSAGE TYPE',T_ERRORMSG-MSGTYP,
'FIELDNAME WERE ERROR OCCURED', T_ERRORMSG-FLDNAME.
*CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = T_ERRORMSG-MSGID
LANG = SY-LANGU
NO = T_ERRORMSG-MSGNR
V1 = T_ERRORMSG-MSGV1
V2 = T_ERRORMSG-MSGV2
V3 = T_ERRORMSG-MSGV3
V4 = T_ERRORMSG-MSGV4
IMPORTING
MSG = E_MESSAGE
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:/ E_MESSAGE.
ENDLOOP.
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 <> SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
With Regards
K Srinivas -
Hi all, BDC call transaction METHOD, trapping ERRORS
hi
i have developed BDC (recording via call transaction method) for VB01.
could u please tell me how to display records having errors after running recording or to give index of records having errors.
and is it possible to give transaction code for recording since my bdc is executable program.
plase answer both the questions.
thanxHere is the flow that Raja is explaining to you.
DATA: v_index LIKE sy-tabix.
LOOP AT itab.
v_index = sy-tabix.
*-- prepare the BDC data
CALL TRANSACTION 'VB01' USING bdcdata
MODE 'N'
MESSAGES INTO bdcmsgcoll.
READ TABLE bdcmsgcoll WITH KEY msgtyp = 'E'.
IF sy-subrc = 0.
*-- Error occured for the record with index <b>v_index</b>
ELSE.
*-- unless there is a success message with this number,
* it is not succesfull because 'No data for screen xxx'
* will not show up as an error message type, but will be
* a success message type
READ TABLE bdcmsgcoll WITH KEY msgnr = '312'.
IF sy-subrc = 0.
*-- success
ELSE.
*-- error with index <b>v_index</b>
ENDIF.
ENDIF.
ENDLOOP.
As you can see, now you have the index of the record where the error occured. Now this will become complicated if you are combining several records into one transaction call. In that case you need to find how you can know all the records that you just accumulated.
As an example, let us say you have an internal table with external number, customer, material, quantity and at every new external number, you want to create a sales order. Until you get a new external number, you will not do the call transaction because until then it will be items of the same sales order. So in this case, after the call transaction, you will have get all the records that belong to making this sales order by using the external number and then prepare your messages.
I hope this is clear.
Srinivas
Message was edited by: Srinivas Adavi -
In bdc call transaction method which one ll prefer synchronous or asynchron
hi could anybody tel me
call transaction method which one is preferred synchronous or asynchronous..?
what ll happen if we do other method..?
foreground or background which one ll prefer..?
what ll happen if we do otehr method..?
on which condition we have to use synchronous and asynchronous
on which condition we have to use foreground and background
thanx
kals.Hi,
if you haven't done yet please visit for general information:
http://help.sap.com/saphelp_nw70/helpdata/en/d2/f8f3393bef4604e10000000a11402f/frameset.htm
for further information:
http://help.sap.com/saphelp_nw70/helpdata/en/69/c2501a4ba111d189750000e8322d00/frameset.htm
This will hopefully answer your question.
Regards
Bernd -
Simple doubt in BDC Call Transaction Method
Hi Friends,
When i try to call vk13 transaction and pass the screen field values for the second screen and execute it it is displaying properly.But when i try to pass the different value in the bcddata internal table it is changing properly but in the screen it not updating that value.Alawly the screen fields are taking the values passed the first time.But in the internal table which we are oassing to the calltransaction it is changing correctly but not in the corresponding screen fields. Why it is happening so. Can any one help me out of this problem.
Thanks in Advance.I am not passing through the selection screen . It is like iteractive report. when i select the particular line in the list output then the screen fields should take the values from that selected line. First time when i select the line it is taking properly.
But next time when i select the line the content of the i_bdc_tbl is changing correctly but when it enter in to the transaction it is not taking the values from the i_bdc_tbl. Simply it is displaying the screen fields with the old values. It is not updating the screen fields with the values from the i_bdc_tbl. Why the screen fields are not replaced with the value of i_bdc_tbl? Why it is not getting refreshed with the new values?
Just i am posting the bdc portion of my code here. So you can help me out on this.
AT LINE-SELECTION.
SELECT SINGLE kozgf FROM t685 INTO v_kozgf
WHERE kschl = wa_report-kschl.
SELECT kolnr kotabnr FROM t682i INTO TABLE i_t682i
WHERE kozgf = v_kozgf.
SORT i_t682i BY kolnr.
READ TABLE i_t682i WITH KEY kotabnr = wa_report-tabna+1(3)
TRANSPORTING NO FIELDS.
CHECK sy-subrc = 0.
v_index = sy-tabix.
REFRESH i_bdc_tbl.
l_tabix = '01'.
PERFORM f_vk13.
CONCATENATE 'RV13' wa_report-tabna INTO v_bdc_val_field.
PERFORM bdc_dynpro USING v_bdc_val_field '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'F004-LOW'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ONLI'.
CREATE DATA v_rec TYPE (wa_report-tabna).
ASSIGN v_rec->* TO <wa_table>.
SELECT SINGLE * FROM (wa_report-tabna) INTO <wa_table>
WHERE kschl = wa_report-kschl AND matnr = wa_report-matnr AND knumh = wa_report-objectid.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = wa_report-tabna
TABLES
dfies_tab = lwa_tabna
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
READ TABLE lwa_tabna WITH KEY fieldname = 'KSCHL'.
p1 = sy-tabix + 1.
READ TABLE lwa_tabna WITH KEY fieldname = 'MATNR'.
p2 = sy-tabix.
LOOP AT lwa_tabna.
v_field = lwa_tabna-fieldname.
IF lwa_tabna-position BETWEEN p1 AND p2.
ASSIGN COMPONENT lwa_tabna-position OF STRUCTURE <wa_table> TO <fld>.
PERFORM f_vk13_s2 USING lwa_tabna-fieldname <fld>.
ENDIF.
ENDLOOP.
PERFORM bdc_field USING 'RV130-DATAM'
wa_report-fdate_value_new.
PERFORM bdc_field USING 'BDC_OKCODE'
'ONLI'.
PERFORM bdc_field USING 'BDC_CURSOR'
'F001'.
CALL TRANSACTION 'VK13' USING i_bdc_tbl
MODE 'A'.
FORM f_vk13.
DATA: l_tabix(2) TYPE c.
*Condition type
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RV13A-KSCHL'
wa_report-kschl.
*Key combination
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_field USING 'RV130-SELKZ(01)'
l_tabix = v_index.
SHIFT l_tabix RIGHT.
OVERLAY l_tabix WITH '00'.
CONCATENATE 'RV130-SELKZ(' l_tabix ')' INTO v_bdc_field.
PERFORM bdc_field USING v_bdc_field
'X'.
ENDFORM. "f_vk13
FORM BDC_DYNPRO
This form accepts the program name and screen number
and places the values into the I_BDC_TBL internal table.
FORM bdc_dynpro USING program dynpro.
CLEAR wa_bdc_tbl.
wa_bdc_tbl-program = program.
wa_bdc_tbl-dynpro = dynpro.
wa_bdc_tbl-dynbegin = 'X'.
APPEND wa_bdc_tbl TO i_bdc_tbl.
ENDFORM. "BDC_DYNPRO
FORM F_BDC_FIELD
This form accepts the field name and the corresponding value
for that field and places them into the I_BDC_TBL internal table.
FORM bdc_field USING fnam fval.
CLEAR wa_bdc_tbl.
MOVE fnam TO wa_bdc_tbl-fnam.
MOVE fval TO wa_bdc_tbl-fval.
APPEND wa_bdc_tbl TO i_bdc_tbl.
ENDFORM. "BDC_FIELD
*& Form f_vk13_s2
text
--> p1 text
<-- p2 text
FORM f_vk13_s2 USING p_fieldname p_fld.
CONCATENATE wa_report-tabna '-' p_fieldname INTO v_bdc_val_field.
CHECK NOT p_fld IS INITIAL.
PERFORM bdc_field USING v_bdc_val_field p_fld.
ENDFORM. " f_vk13_s2
Thanks. -
Error Capturing in BDC Call Transaction Method
How does the Errors in BDC Call Transactin is captured ....can you please give same examples of using BDCMSGCOLL and FORMAT_MESSAGES..
Please explain clearly when to used these in real time..
Thankyouhi,
Here is hte sample code
call transaction 'ME22' using it_bdc
options from x_ctu_params
messages into lt_message.
clear w_success.
if sy-subrc <> 0.
w_success = 'N'.
endif.
loop at lt_message where msgtyp = 'E' or
msgtyp = 'A'.
endloop.
if sy-subrc = 0.
perform format_messages tables lt_message
using lv_msg lv_lines.
* To append error messages
perform append_message tables lt_message
return
using lv_msg.
else.
if w_success = 'N'.
perform format_messages tables lt_message
using lv_msg lv_lines.
perform append_message_err tables lt_message
return
using lv_msg.
else.
perform format_messages tables lt_message
using lv_msg lv_lines.
* To append success messages
perform append_message tables lt_message
return
using lv_msg.
endif.
endif.
refresh: it_bdc,
lt_message.
endat.
endloop.
endif.
form format_messages tables pt_messages structure bdcmsgcoll
using pv_msg pv_lines.
clear : pv_lines,pt_messages,pv_msg.
describe table pt_messages lines pv_lines.
read table pt_messages index pv_lines.
check not pt_messages-msgid is initial.
*-- Function module to format the message given
call function 'FORMAT_MESSAGE'
exporting
id = pt_messages-msgid
lang = sy-langu
no = pt_messages-msgnr
v1 = pt_messages-msgv1
v2 = pt_messages-msgv2
v3 = pt_messages-msgv3
v4 = pt_messages-msgv4
importing
msg = pv_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 into pv_msg.
endif.
endform. " format_messages
Regards,
Richa -
Should 'call transaction' be called inside the loop or outside the loop in BDC?
Hi Sangeeta,
It depends on the scenario in which your going to call the transaction. Consider a situation in which I was required to write a BDC program for Task List dependency editor (IA06 transaction). Every Task List can have a number of operations and operation can have suboperations. I was required to call the transaction for only the Task List Number and not for individual operations and suboperations. In such a scenario , we populate the BDCDATA internal table inside a loop . The process of calling the transaction can be done in the loop itself (using some flags and ON CHANGE and IF statements) or after the Task List Number changes exit the loop(using the EXIT statement) and then do the call transaction. So its just the ease with which you can implement your logic, that you call the transaction inside the loop or outside the loop. The only thing to be remembered is that BDCDATA internal table should be populated before you call the transaction. -
Problem in uploading material master data using BDC?
Hi all,
I am using BDC call transaction method to upload material data. Here i am facing a problem that a value in the flat file is going to the wrong screen field . But my recording done properly.
In recording, after entering the data in the view BASIC DATA1 and trying to enter the text . For this i need to scroll down the scroll bar and after that i am clicking on basic data text and entering the text. Here i am not touching the languge field.
But the problem is the text to be entered into the basic data text is storing in language and giving error.
Please help me by specifying the reason and solution for this problem? Whether i did any mistake in recording in scrolling?
Thanks,
Vamshi.Hi
Go with BAPI for such huge transactions and screens. Use BAPI: BAPI_MATERIAL_SAVEDATA.
Regards,
Vishwa. -
BDC Call Transaction - Doc.No not getting generated in Message Internal tab
Dear All,
I am using BDC Call Transaction method for uploading data for transaction, Iam able to successfully capture the Error messages, sucess messages and the transaction number is also displayed for the bdc run in Mode A, but in case of scheduling the job in background, the Error messages are displayed but the transaction number is not captured in the message Internal table( BDCMSGCOLL).
Kindly look into the matter and revert back for any further info.
Regards
NareshHi,
Please try using the following kind of code in 'CALL TRANSACTION'
opt-dismode = 'E'. " Exclusive mode
opt-defsize = 'X'.
opt-updmode = 'S'.
opt-nobinpt = ' '.
CALL TRANSACTION transaction_code USING ft OPTIONS FROM opt
MESSAGES INTO t_bdcmsgcoll .
Hope this will work.
Thanks,
Leo
Maybe you are looking for
-
just got a new ipad2...recognizes wifi network at home, but can't connect to internet...help???
-
IPhone 4S won't delete camera roll...
Well, My camera roll is taking up 39 GB, so I want to delete the camera roll. I go to Settings, Usage, Photos and Camera, swipe left on Camera Roll, delete button shows up, press delete. It does nothing. It refused to delete it. I have restared the p
-
How do I return to recent email after doing a search?
How do I quickly return to recent mail again after doing a search in Mail? After I look at an old email I've found and click the "x" next to the search entry field to clear it, I'm returned back to the entire mail box at the point in time of that fou
-
Installing OS 8 or 9 on beige G3
Hi, I have a hard time installing an OS on my beige G3! I have an original CD for OS 8.0 but the G3 refuses to boot from it saying that this version is too old for this machine. Anyway to install it? I also have the disks for the G4 Cube, but then it
-
How to reconfigure the tcp/ip stack in Solar8 to include my STREAMS module?
I am currently writing a NAT STREAMS module that I would like to place on the tcp/ip stack so it intercepts all incoming and outgoing packets going to or coming from the IP module. I want the stack to look like the following: Current Solaris Stack: h