BDC FOR VA01
CAN ANYONE SEND ME BDC PROGRAM FOR VA01 OR XD01
PLZZZ
Hi Raj,
This is a sample both BDC & Call Transaction program for TCode XD01. Choose the radio button while executing which you want to run
Give any Text File in your Presentation Layer with the fields given in the internal table "itab".
*& Report ZA1CTBI
REPORT za1ctbi.
TYPES: BEGIN OF ty_cust,
ktokd TYPE kna1-ktokd,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
sortl TYPE kna1-sortl,
ort01 TYPE kna1-ort01,
land1 TYPE kna1-land1,
spras TYPE kna1-spras,
pstlz TYPE kna1-pstlz,
lzone TYPE kna1-lzone,
END OF ty_cust.
DATA: itab TYPE TABLE OF ty_cust,
wa LIKE LINE OF itab,
bdctab TYPE TABLE OF bdcdata,
wa1 LIKE LINE OF bdctab,
messtab TYPE TABLE OF bdcmsgcoll,
wa2 LIKE LINE OF messtab,
d_mode(1) TYPE c,
d_update(1) TYPE c,
session(12) TYPE c,
date TYPE dats,
message(73) TYPE c.
PARAMETERS: ct RADIOBUTTON GROUP radi,
mode LIKE d_mode DEFAULT 'A',
update LIKE d_update DEFAULT 'A',
bi RADIOBUTTON GROUP radi,
ses_name LIKE session DEFAULT 'CUST',
k_date LIKE date DEFAULT sy-datum,
k_sess AS CHECKBOX DEFAULT 'X'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\aaa.txt'
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF ct = 'X'.
PERFORM call_transaction.
ELSE.
PERFORM batch_input.
ENDIF.
*& Form CALL_TRANSACTION
text
--> p1 text
<-- p2 text
FORM call_transaction .
LOOP AT itab INTO wa.
REFRESH bdctab.
REFRESH messtab.
PERFORM bdc.
CALL TRANSACTION 'XD01' USING bdctab
MODE mode
UPDATE update
MESSAGES INTO messtab.
LOOP AT messtab INTO wa2.
SELECT SINGLE text INTO message
FROM t100
WHERE arbgb = wa2-msgid
AND msgnr = wa2-msgnr
AND sprsl = 'EN'.
IF sy-subrc = 0.
REPLACE '&' IN message WITH wa2-msgv1.
WRITE:/ message.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM. " CALL_TRANSACTION
*& Form BDC
text
--> p1 text
<-- p2 text
FORM bdc .
SCREEN 1
PERFORM bdc_dynpro USING 'SAPMF02D' '0100'.
PERFORM bdc_field USING 'RF02D-KTOKD' wa-ktokd.
PERFORM bdc_field USING 'RF02D-KUNNR' wa-kunnr.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
SCREEN 2
PERFORM bdc_dynpro USING 'SAPMF02D' '0110'.
PERFORM bdc_field USING 'KNA1-NAME1' wa-name1.
PERFORM bdc_field USING 'KNA1-SORTL' wa-sortl.
PERFORM bdc_field USING 'KNA1-ORT01' wa-ort01.
PERFORM bdc_field USING 'KNA1-LAND1' wa-land1.
PERFORM bdc_field USING 'KNA1-SPRAS' wa-spras.
PERFORM bdc_field USING 'KNA1-PSTLZ' wa-pstlz.
PERFORM bdc_field USING 'KNA1-LZONE' wa-lzone.
PERFORM bdc_field USING 'BDC_OKCODE' '=UPDA'.
ENDFORM. " BDC
*& Form bdc_dynpro
text
-->P_0294 text
-->P_0295 text
FORM bdc_dynpro USING program
dynpro.
CLEAR wa1.
wa1-program = program.
wa1-dynpro = dynpro.
wa1-dynbegin = 'X'.
APPEND wa1 TO bdctab.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0299 text
-->P_0300 text
FORM bdc_field USING fnam
fval.
IF fval <> space.
CLEAR wa1.
wa1-fnam = fnam.
wa1-fval = fval.
APPEND wa1 TO bdctab.
ENDIF.
ENDFORM. " bdc_field
*& Form BATCH_INPUT
text
--> p1 text
<-- p2 text
FORM batch_input .
PERFORM bdc_open.
LOOP AT itab INTO wa.
REFRESH bdctab.
PERFORM bdc.
PERFORM bdc_insert.
ENDLOOP.
PERFORM bdc_close.
ENDFORM. " BATCH_INPUT
*& Form BDC_OPEN
text
--> p1 text
<-- p2 text
FORM bdc_open .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = ses_name
holddate = k_date
keep = k_sess
user = sy-uname
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.
ENDFORM. " BDC_OPEN
*& Form BDC_INSERT
text
--> p1 text
<-- p2 text
FORM bdc_insert .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'XD01'
TABLES
dynprotab = bdctab
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.
ENDFORM. " BDC_INSERT
*& Form BDC_CLOSE
text
--> p1 text
<-- p2 text
FORM bdc_close .
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.
ENDFORM. " BDC_CLOSE
<b>Reward if helpful,</b>
Regards,
Adithya M.
Similar Messages
-
BDC for VA01 and VL01 - Needed
Hi experts,
Can anyone give ur valuable ideas for the following scenario.
I need to create recording for Sales order creation(VA01) and Delivery creation(VL01) tcodes. But VA01 should be created in foreground and VL01 in background for the corresponding Sales order automatically.
I mean, the user has to enter the values for sales order creation, once it ll be created, automatically delivery should be created in background. This is the scenario given by my client.
Kindly give some step by step procedure to do so...
Thanks in advance...
Regards
Raaams...Hi,
Correct me if i have not got your requirement.
Once the sales order is saved, you need to create delivery automatically. Right ?
If this is the requirement, then you don't need BDC for both the transaction.
What you have to do is identify the BADI(method) called up when your is sales order is saved.
Use BAPI_DELIVERYPROCESSING_EXEC for creating a delivery in the method of BADI.
Let me know if in case u need more details.
Thanks,
Kartavya -
BDC For VA01(For MULTIPLE Material ie Multiple Line Items)
i have to do A BDC using call trasncation which has Multiple material in line items,so please could you send me some sample code
Hii pls refer the following code.. it is BDC for me31k.. hop this will help....
*& Report name : ZOA_P1 *&
*& Program title : Outline agreement Creation program *&
*& Description : BDC program which creates outline *&
*& agreement *&
*& Author : Sheeba B *&
*& Author ID : 5855 *&
REPORT zoa_p1
NO STANDARD PAGE HEADING LINE-SIZE 100.
include program***************************
INCLUDE zbdcrecx4.
*C-structure for table ekko fields
TYPES:BEGIN OF tp_temp,
lifnr TYPE lifnr,
ekorg TYPE ekorg,
ekgrp TYPE ekgrp,
bukrs TYPE bukrs,
END OF tp_temp.
****************Declarations********************
*C-variables for table ekko field
DATA: BEGIN OF tp_final OCCURS 0,
lifnr TYPE lifnr,
ekorg TYPE ekorg,
ekgrp TYPE ekgrp,
bukrs TYPE bukrs,
ematn TYPE ematn,
ktmng TYPE ktmng,
netpr TYPE netpr,
werks TYPE werks,
END OF tp_final,
*C-variables used in the program
wa_temp TYPE tp_temp,
*C-variable for entering multiple item level details
*C-for same vendor
w_count(2) TYPE c VALUE '01',
w_count(2) type N value 01,
w_str(40) TYPE c,
w_str1 TYPE string.
*C-selection screen parameter for file name
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(20) text-000 FOR FIELD f_name.
SELECTION-SCREEN POSITION 25.
PARAMETERS: f_name LIKE rlgrap-filename.
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_name.
CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
EXPORTING
def_filename = 'F_NAME'
def_path = 'C:\'
mask = '.TXT'
MODE = ' '
TITLE = ' '
IMPORTING
filename = f_name
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
*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 of selection*********
START-OF-SELECTION.
*C-function for uploading file from workstation
w_str1 = f_name.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_str1
FILETYPE = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = tp_final
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.
*C-looping at internal table for passing
*C-field values to transaction
LOOP AT tp_final.
MOVE :tp_final-lifnr TO wa_temp-lifnr,
tp_final-ekorg TO wa_temp-ekorg,
tp_final-ekgrp TO wa_temp-ekgrp,
tp_final-bukrs TO wa_temp-bukrs.
*C-for each new vendor
*C-pass header details to transaction
AT NEW lifnr.
REFRESH bdcdata.
PERFORM :bdc_dynpro USING 'SAPMM06E' '0200',
bdc_field USING 'BDC_OKCODE'
'/00',
bdc_field USING 'EKKO-LIFNR'
wa_temp-lifnr,
bdc_field USING 'EKKO-EKORG'
wa_temp-ekorg,
bdc_field USING 'EKKO-EKGRP'
wa_temp-ekgrp,
bdc_dynpro USING 'SAPMM06E' '0514',
bdc_field USING 'BDC_OKCODE'
'=ENTE',
bdc_field USING 'EKKO-BUKRS'
wa_temp-bukrs,
bdc_dynpro USING 'SAPMM06E' '0201',
bdc_field USING 'BDC_OKCODE'
'/00',
bdc_field USING 'EKKO-KDATE'
'12/31/9999'.
ENDAT.
*C-passing item level details to transaction
PERFORM :bdc_dynpro USING 'SAPMM06E' '0220',
bdc_field USING 'BDC_OKCODE'
'/00'.
CONCATENATE 'EKPO-EMATN(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-ematn.
CONCATENATE 'EKPO-KTMNG(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-ktmng.
CONCATENATE 'EKPO-NETPR(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-netpr.
CONCATENATE 'EKPO-WERKS(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-werks.
PERFORM:bdc_dynpro USING 'SAPMM06E' '0211',
bdc_dynpro USING 'SAPMM06E' '0220',
bdc_field USING 'BDC_OKCODE'
'/00'.
*C-Incrementing count for insertin next
*C-line item for the same vendor
w_count = w_count + '01'.
CONCATENATE '0' w_count INTO w_count.
*C-For different vendors save details and create contract.
AT END OF lifnr.
PERFORM : bdc_dynpro USING 'SAPMM06E' '0211',
bdc_dynpro USING 'SAPMM06E' '0220',
bdc_field USING 'BDC_CURSOR'
'RM06E-EBELP',
bdc_field USING 'BDC_OKCODE'
'=BU',
bdc_transaction USING 'ME31K'.
*C-resetting w_count for new vendor
w_count = '01'.
ENDAT.
ENDLOOP. -
Problem in BDC for VA01 transaction TEXTS tab(Upgrading from 4.5b to ECC6)
Hi All,
I am working in upgrade project from 4.5b version to ECC6 version.
I am facing problem in TEXTS tab of VA01 transaction. In earlier version it is a table control containing of Language, Description & First line but, in ECC6 the screen is modified with texteditor, a list box for language key and a Text type at the left.
Now my problem is how to record this in BDC and how to read the text in the texteditor?
Thanks in Advance,
Ravi Kiran.Hi Seshagiri,
In this case i would suggest the use of BAPI if there's no compulsion to use BDC.
BAPI_SALESORDER_CHANGE Sales order: Change Sales Order
BAPI_SALESORDER_CONFIRMDELVRY
BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More
BAPI_SALESORDER_GETLIST Sales order: List of all Orders for Customer
BAPI_SALESORDER_GETSTATUS Sales Order: Display Status
BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
try using these for creation or change of orders instead of bdcs.
hope this helps and revert for more clarifications if any.
<b>Always reward points to useful suggestions.</b>
regards,
Vikas -
Dear Experts,
I have developed a BDC Program for transaction VA01, if there is change in price it shows warning message as 'Condition PR00 has been changed' and loose the control, at that time if click on enter it will regain the control and proceed further.
I have added an extra code for 'enter' but its not working, please share your ideas to fix this issue.
thanks in advance...
VenkatHi Madhukar,
thanks for writing.
yes when I execute program in forground it shows warning message and looses the control.
If execute in background it will not create SO at all.
I tried to do recording for this case again but even while recording also it looses the control when I press enter then it will regain the control but that wont recorded.
Regards,
Venkat -
BDC for VA01 with multiple line items
Hi,
My client is 4.6c version, I have created a BDC program for transaction VA01 which will have multiple line items. I'm able to enter 12 items in the first instance, then 12 items next time. But I'm not doing any P+..System is automatically taking me to first item after reaching item 12 every time.
But I have a doubt in production system also I will have only 12 items every time to enter..If not my program may not work..
I'm calling BDC using following statment..
CALL TRANSACTION 'VA01' USING BDCDATA
MODE 'N'
UPDATE 'S'
MESSAGES INTO lt_message.
Please suggest me the solution.
Regards
Jaker.I had a similar problem with goods movements in a CO11N BDC I wrote. Here's how it was fixed:
DATA: lcl_opt TYPE ctu_params.
lcl_opt-defsize = 'X'.
CALL TRANSACTION 'CO11N' USING i_bdctbl OPTIONS FROM lcl_opt
MESSAGES INTO messco11n.
The option "defsize" makes sure that the screen always contains the same number of lines as it goes through the BDC. That way, you can write in the paging logic without having to worry about the number of lines that appear on a user's screen as it may vary depending on how their screen resolution is set up. -
BDC for multiple line items (VA01)
Hi Experts,
I create a BDC for VA01 transaction for single line item in that now i want to upload multiple line items also with o/p of total no. of records uploaded, no. of records posted and the no. of error records...
Can any body explain with sample code...Hi,
if the flat file is containing header and item records...
first split those records tooo two internal tables header and item..
Loop at header ...
process of recording steps for header....
Loop at item...
here create a varialbe with char 2 .. for index value....
process of item recording steps..
increment the index value by 1....
here u have to pass 'p+' OK_CODE..
Endloop ..(item)
Endloop...(header)
for more info goo through this link...
http://www.sap-img.com/bdc.htm
hope helpful
Raghunath.S -
hi friends.
how to create a bdc for va01... i need step by step procedure. please help me...Hi
BDC (Batch Data Communication) works based on the data in the Internal table of structure "BDCDATA", and some of the very important lines with information (in sequence) Dynpro, Cursor-field and Data Fields, then call Transaction / Session Creation Logic.
In Call Transaction method of BDC, the Message is handled manually using the structure "BDCMSGCOLL" and by refering to messages in "T100" Table. [Refer the standard Include BECRECX1 for more information.
BDC can be created by Recording tool or my scracth creating a new program. Use transaction code 'SHDB'.
A sample code by using the Recording method (Here both Call transaction and Session Method of BDC will be created by standard Recording tool [this you can find in include BDCRECX1])
Code Only the Program, withoug Include BDCRECX1 (This std, inclu you can find)
***INCLUDE BDCRECX1.
* for programs doing a data transfer by creating a batch-input session
* and
* for programs doing a data transfer by CALL TRANSACTION USING
selection-screen begin of line.
parameters session radiobutton group ctu. "create session
selection-screen comment 3(20) text-s07 for field session.
selection-screen position 45.
parameters ctu radiobutton group ctu. "call transaction
selection-screen comment 48(20) text-s08 for field ctu.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s01 for field group.
selection-screen position 25.
parameters group(12). "group name of session
selection-screen comment 48(20) text-s05 for field ctumode.
selection-screen position 70.
parameters ctumode like ctu_params-dismode default 'N'.
"A: show all dynpros
"E: show dynpro on error only
"N: do not display dynpro
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s02 for field user.
selection-screen position 25.
parameters: user(12) default sy-uname. "user for session in batch
selection-screen comment 48(20) text-s06 for field cupdate.
selection-screen position 70.
parameters cupdate like ctu_params-updmode default 'L'.
"S: synchronously
"A: asynchronously
"L: local
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s03 for field keep.
selection-screen position 25.
parameters: keep as checkbox. "' ' = delete session if finished
"'X' = keep session if finished
selection-screen comment 48(20) text-s09 for field e_group.
selection-screen position 70.
parameters e_group(12). "group name of error-session
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s04 for field holddate.
selection-screen position 25.
parameters: holddate like sy-datum.
selection-screen comment 51(17) text-s02 for field e_user.
selection-screen position 70.
parameters: e_user(12) default sy-uname. "user for error-session
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 51(17) text-s03 for field e_keep.
selection-screen position 70.
parameters: e_keep as checkbox. "' ' = delete session if finished
"'X' = keep session if finished
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 51(17) text-s04 for field e_hdate.
selection-screen position 70.
parameters: e_hdate like sy-datum.
selection-screen end of line.
selection-screen skip.
selection-screen begin of line.
selection-screen comment 1(33) text-s10 for field nodata.
parameters: nodata default '/' lower case. "nodata
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) text-s11 for field smalllog.
parameters: smalllog as checkbox. "' ' = log all transactions
"'X' = no transaction logging
selection-screen end of line.
* data definition
* Batchinputdata of single transaction
data: bdcdata like bdcdata occurs 0 with header line.
* messages of call transaction
data: messtab like bdcmsgcoll occurs 0 with header line.
* error session opened (' ' or 'X')
data: e_group_opened.
* message texts
tables: t100.
* at selection screen *
at selection-screen.
* group and user must be filled for create session
if session = 'X' and
group = space or user = space.
message e613(ms).
endif.
* open dataset *
form open_dataset using p_dataset.
open dataset p_dataset
for input in text mode
encoding default.
if sy-subrc <> 0.
write: / text-e00, sy-subrc.
stop.
endif.
endform.
* close dataset *
form close_dataset using p_dataset.
close dataset p_dataset.
endform.
* create batchinput session *
* (not for call transaction using...) *
form open_group.
if session = 'X'.
skip.
write: /(20) 'Create group'(i01), group.
skip.
* open batchinput group
call function 'BDC_OPEN_GROUP'
exporting client = sy-mandt
group = group
user = user
keep = keep
holddate = holddate.
write: /(30) 'BDC_OPEN_GROUP'(i02),
(12) 'returncode:'(i05),
sy-subrc.
endif.
endform.
* end batchinput session *
* (call transaction using...: error session) *
form close_group.
if session = 'X'.
* close batchinput group
call function 'BDC_CLOSE_GROUP'.
write: /(30) 'BDC_CLOSE_GROUP'(i04),
(12) 'returncode:'(i05),
sy-subrc.
else.
if e_group_opened = 'X'.
call function 'BDC_CLOSE_GROUP'.
write: /.
write: /(30) 'Fehlermappe wurde erzeugt'(i06).
e_group_opened = ' '.
endif.
endif.
endform.
* Start new transaction according to parameters *
form bdc_transaction using tcode.
data: l_mstring(480).
data: l_subrc like sy-subrc.
* batch input session
if session = 'X'.
call function 'BDC_INSERT'
exporting tcode = tcode
tables dynprotab = bdcdata.
if smalllog <> 'X'.
write: / 'BDC_INSERT'(i03),
tcode,
'returncode:'(i05),
sy-subrc,
'RECORD:',
sy-index.
endif.
* call transaction using
else.
refresh messtab.
call transaction tcode using bdcdata
mode ctumode
update cupdate
messages into messtab.
l_subrc = sy-subrc.
if smalllog <> 'X'.
write: / 'CALL_TRANSACTION',
tcode,
'returncode:'(i05),
l_subrc,
'RECORD:',
sy-index.
loop at messtab.
select single * from t100 where sprsl = messtab-msgspra
and arbgb = messtab-msgid
and msgnr = messtab-msgnr.
if sy-subrc = 0.
l_mstring = t100-text.
if l_mstring cs '&1'.
replace '&1' with messtab-msgv1 into l_mstring.
replace '&2' with messtab-msgv2 into l_mstring.
replace '&3' with messtab-msgv3 into l_mstring.
replace '&4' with messtab-msgv4 into l_mstring.
else.
replace '&' with messtab-msgv1 into l_mstring.
replace '&' with messtab-msgv2 into l_mstring.
replace '&' with messtab-msgv3 into l_mstring.
replace '&' with messtab-msgv4 into l_mstring.
endif.
condense l_mstring.
write: / messtab-msgtyp, l_mstring(250).
else.
write: / messtab.
endif.
endloop.
skip.
endif.
** Erzeugen fehlermappe ************************************************
if l_subrc <> 0 and e_group <> space.
if e_group_opened = ' '.
call function 'BDC_OPEN_GROUP'
exporting client = sy-mandt
group = e_group
user = e_user
keep = e_keep
holddate = e_hdate.
e_group_opened = 'X'.
endif.
call function 'BDC_INSERT'
exporting tcode = tcode
tables dynprotab = bdcdata.
endif.
endif.
refresh bdcdata.
endform.
* 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 <> nodata.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
append bdcdata.
endif.
endform.
Refer this link as an example:
<b>http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm</b>
Alternatively, Press the Item To Top Button(The 4th from left)Under the Item Table control, every time you want to enter item details,
This would bring the item to the top of the table control every time.
Record the transaction this way, and code for your BDC.
Another alternative is to use a bapi:
<b>BAPI_SALESORDER_CREATEFROMDAT2</b>
Regards,
Rk
Message was edited by:
Rk Pasupuleti -
Hi frnds,
I hav written BDC for VA01 transaction. But i m very new to BDC so i want to hav a look into a code which updates each and every table control and updates the whole of the VA01 transaction i.e TAX UPDATE AND ALL.
I M GIVING A SAMPLE CODE I HAV WRITTEN BUT I NEED TO UPDATED ALL THE TABLE CONTROLS PRESENT IN THE TRANSACTION.
REPORT zmas_bdctable .
*include bdcrecx1.
TYPES : BEGIN OF ty_head,
auart(4), "Sales Document Type
vkorg(4), "Sales Organization
vtweg(2), "Distribution Channel
spart(2), "Division
kunnr(10), "sold-to-party
bstkd(10), "Customer purchase order number
END OF ty_head.
TYPES: BEGIN OF ty_item,
matnr(18) TYPE c, "Material
kwmeng(13) TYPE c, "Quantity
END OF ty_item.
DATA: it_head TYPE TABLE OF ty_head.
DATA: wa_head LIKE LINE OF it_head.
DATA: it_item TYPE TABLE OF ty_item.
DATA: wa_item LIKE LINE OF it_item.
DATA :bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA:v_kwmeng(30) TYPE c,
v_mabnr(30) TYPE c.
DATA: val(2) TYPE n VALUE 01.
DATA : w_file2 TYPE string,
w_file1 TYPE string.
PARAMETERS: filename LIKE rlgrap-filename.
PARAMETERS: filenam1 LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filenam1.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = filenam1.
START-OF-SELECTION.
w_file2 = filename.
w_file1 = filenam1.
HEADER ************************
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_file2
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_head.
ITEM *******************
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_file1
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_item.
**********CREATE SESSION***************
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = 'TABLECONT'
keep = 'X'
user = sy-uname.
******POPULATE BDCDATABLE***************
PERFORM open_group.
LOOP AT it_head INTO wa_head.
PERFORM bdc_dynpro USING 'SAPMV45A' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VBAK-AUART'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'VBAK-AUART'
wa_head-auart.
PERFORM bdc_field USING 'VBAK-VKORG'
wa_head-vkorg.
PERFORM bdc_field USING 'VBAK-VTWEG'
wa_head-vtweg.
PERFORM bdc_field USING 'VBAK-SPART'
wa_head-spart.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'VBKD-BSTKD'
wa_head-bstkd.
PERFORM bdc_field USING 'VBKD-BSTDK'
'30.01.2006'.
PERFORM bdc_field USING 'KUAGV-KUNNR'
wa_head-kunnr.
PERFORM bdc_field USING 'RV45A-KETDAT'
'30.01.2006'.
PERFORM bdc_field USING 'RV45A-KPRGBZ'
'D'.
PERFORM bdc_field USING 'VBKD-ZTERM'
'0001'.
PERFORM bdc_field USING 'VBKD-INCO1'
'CIF'.
PERFORM bdc_field USING 'VBKD-INCO2'
' COST INSUSRABCE FRIEGHT'.
LOOP AT it_item INTO wa_item .
CONCATENATE 'RV45A-MABNR(' '0' val ')' INTO v_mabnr.
CONCATENATE 'RV45A-KWMENG(' '0' val ')' INTO v_kwmeng.
PERFORM bdc_field USING 'BDC_CURSOR'
v_kwmeng.
PERFORM bdc_field USING v_mabnr
wa_item-matnr.
PERFORM bdc_field USING v_kwmeng
wa_item-kwmeng.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
val = val + 1.
IF val > 5.
val = 5.
ENDIF.
ENDLOOP.
val = 01.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'VA01'
TABLES
dynprotab = bdcdata.
REFRESH bdcdata.
*PERFORM bdc_transaction USING 'VA01'.
ENDLOOP.
PERFORM close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
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.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELDFrnds,
My requirement is while performing BDC for standard trasaction VA01
using a material i want to update the schedule lines and condition types.
Both of them are separate table controls. So if anyone can provide the logic or code for the above will be helpful for me.
looking for whole hearted help.
regards,
kamal -
Code for va01 bdc table control
hi
i want to CODE FOR bdc table control VA01 (TCODE)
ASAPAwadhesh,
just refer:
Problem in the BDC Table Control for the T.Code VA01
BDC Uploading from flat file to VA01.
BDC For Line Items In Sales Order
dont forget reward.
Amit. -
I am posting data for va01 and va02 using BDC session,what happens if
Hi,
I am posting some data for va01 and va02 using BDC session,but what happens if i try to post same data using call transaction.Hi,
That is just another method. You can post the data using Call Transaction as well.
Just give it a try and in case you face some problem revert back with your issue.
We will help you to solve the same.
Hope this helps!!!
Regards,
Lalit -
Please tell me the BDC for the VA01
Hi,
I have faced problem writing in BDC for standard transaction code VA01. For one sales order creation two or more line items will be there. Then how to write code for the BDC for the VA01. Please help me.
regards
Mohan.imp. the foll. code to handle the multiple line items in sales order.
declare 2 variables:
data: lv_text(100) type c,
lv_cnt(02) type n.
loop at header .
perofrm BDC...
lv_cnt = lv_cnt + 1.
loop at item where vbeln = header-vbeln.
i am giving an ex. for one of the item field, menge i.e, quantity..
u can use same for req. item fields
CONCATENATE 'RV45A-KWMENG' '(' cnt ')' INTO lv_text.
PERFORM bdc_field USING lv_text ' 100'.
here the lv_text contains 'RV45A-KWMENG(01)'.
CLEAR lv_text.
cnt = cnt + 1.
CONCATENATE 'RV45A-KWMENG' '(' cnt ')' INTO lv_text.
PERFORM bdc_field USING lv_text ' 200'.
here lv_text contains 'RV45A-KWMENG(02)'
u can like this upto 99 line items...
clear: lv_text, lv_cnt.
endloop.
call transaction VA02..........using...
endloop.
hope it willbe helpful for u... -
Bdc for sales header text va01
we need to write a bdc program for va01. In that we need to
upload header text also .
So please kindly tell me how to upload flat file to va01 along with
header text.And how we need to declare the flat file.
if it is not possible through bdc then tell me how to do with bapi.
thank you so much for all the repliesRecord the transaction properly for header text along with other fields properly, it will generate the code for you when you save the recording and create the Program using the Recording.
if not You can go with the BAPI,
BAPI : BAPI_SALESORDER_CREATEFROMDAT2
Table parameter ORDER_TEXT is used for the creation of the text.
Read the documentation of the BAPI. -
Pls help me to create SO using BDC for multiple line items (VA01)
Hi all,
My requirement is to create SO for multiple line items in ECC6.0
My recording for VA01 is like this.
start-of-selection.
perform open_group.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
'ZOR'.
perform bdc_field using 'VBAK-VKORG'
'2000'.
perform bdc_field using 'VBAK-VTWEG'
'10'.
perform bdc_field using 'VBAK-SPART'
'05'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-WERKS(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
'hrpocf'.
perform bdc_field using 'VBAP-POSNR(01)'
' 10'.
perform bdc_field using 'RV45A-KWMENG(01)'
' 55'.
perform bdc_field using 'VBAP-WERKS(01)'
'2010'.
perform bdc_dynpro using 'SAPLCEI0' '0109'.
perform bdc_field using 'BDC_CURSOR'
'RCTMS-MWERT(06)'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RCTMS-MNAME(01)'
'A_THICK_MM'.
perform bdc_field using 'RCTMS-MNAME(02)'
'A_WIDTH_MM'.
perform bdc_field using 'RCTMS-MNAME(03)'
'A_EQUIVALENT_SPEC'.
perform bdc_field using 'RCTMS-MNAME(04)'
'A_BATCH_WEIGHT_MAX_SI'.
perform bdc_field using 'RCTMS-MNAME(05)'
'A_BATCH_WEIGHT_MIN_SI'.
perform bdc_field using 'RCTMS-MNAME(06)'
'A_COIL_INNER_DIA_MM'.
perform bdc_field using 'RCTMS-MWERT(01)'
'3.2'.
perform bdc_field using 'RCTMS-MWERT(02)'
'1200'.
perform bdc_field using 'RCTMS-MWERT(03)'
'IS_11513_GR_D_1985'.
perform bdc_field using 'RCTMS-MWERT(04)'
'26.4'.
perform bdc_field using 'RCTMS-MWERT(05)'
'26.4'.
perform bdc_field using 'RCTMS-MWERT(06)'
'610'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-WERKS(02)'.
perform bdc_field using 'RV45A-MABNR(02)'
'hrpocf'.
perform bdc_field using 'VBAP-POSNR(02)'
' 11'.
perform bdc_field using 'RV45A-KWMENG(02)'
' 66'.
perform bdc_field using 'VBAP-WERKS(02)'
'2010'.
perform bdc_dynpro using 'SAPLCEI0' '0109'.
perform bdc_field using 'BDC_CURSOR'
'RCTMS-MWERT(06)'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RCTMS-MNAME(01)'
'A_THICK_MM'.
perform bdc_field using 'RCTMS-MNAME(02)'
'A_WIDTH_MM'.
perform bdc_field using 'RCTMS-MNAME(03)'
'A_EQUIVALENT_SPEC'.
perform bdc_field using 'RCTMS-MNAME(04)'
'A_BATCH_WEIGHT_MAX_SI'.
perform bdc_field using 'RCTMS-MNAME(05)'
'A_BATCH_WEIGHT_MIN_SI'.
perform bdc_field using 'RCTMS-MNAME(06)'
'A_COIL_INNER_DIA_MM'.
perform bdc_field using 'RCTMS-MWERT(01)'
'3.1'.
perform bdc_field using 'RCTMS-MWERT(02)'
'1250'.
perform bdc_field using 'RCTMS-MWERT(03)'
'IS_11513_GR_D_1985'.
perform bdc_field using 'RCTMS-MWERT(04)'
'20.084'.
perform bdc_field using 'RCTMS-MWERT(05)'
'20.084'.
perform bdc_field using 'RCTMS-MWERT(06)'
'610'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=PDE3'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(01)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(01)'
'X'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAP-TAXM1'
'1'.
perform bdc_field using 'VBAP-TAXM2'
'1'.
perform bdc_field using 'VBAP-TAXM3'
'0'.
perform bdc_field using 'VBAP-TAXM4'
'0'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'FDGFDG'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\10'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-POSEX_E'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'000005'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=PDE3'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSNR(02)'.
perform bdc_field using 'RV45A-VBAP_SELKZ(02)'
'X'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAP-TAXM1'
'1'.
perform bdc_field using 'VBAP-TAXM2'
'1'.
perform bdc_field using 'VBAP-TAXM3'
'0'.
perform bdc_field using 'VBAP-TAXM4'
'0'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'GFGFDG'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\10'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-POSEX_E'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'000005'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-POSEX'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'VBAP-POSEX'
'108128'.
perform bdc_field using 'VBKD-BSTKD_E'
'3011192'.
perform bdc_field using 'VBKD-POSEX_E'
'5'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=KKAU'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai east'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\02'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-KONDA'.
perform bdc_field using 'VBAK-AUDAT'
'29.01.2008'.
perform bdc_field using 'VBAK-VKBUR'
'IN15'.
perform bdc_field using 'VBAK-WAERK'
'INR'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-KDGRP'
'CF'.
perform bdc_field using 'VBKD-PLTYP'
'01'.
perform bdc_field using 'VBKD-KONDA'
'01'.
perform bdc_field using 'VBKD-BZIRK'
'NORTH'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\03'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-VSART'.
perform bdc_field using 'VBAK-VSBED'
'01'.
perform bdc_field using 'VBKD-KZAZU'
'X'.
perform bdc_field using 'VBKD-VSART'
'ER'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\05'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-INCO2'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'VBKD-FKDAT'
'29.01.2008'.
perform bdc_field using 'VBAK-TAXK1'
'1'.
perform bdc_field using 'VBAK-TAXK3'
'l'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\09'.
perform bdc_field using 'BDC_CURSOR'
'VBKD-ZLSCH'.
perform bdc_field using 'VBKD-KTGRD'
'01'.
perform bdc_field using 'VBKD-ZLSCH'
'c'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DELETE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_CREATE'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=TP_DETAIL'.
perform bdc_field using 'LV70T-SPRAS'
'EN'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'BDFBFDB'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(02)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=T\11'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'=KSTC'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(02)'.
perform bdc_field using 'J_STMAINT-ANWS(01)'
perform bdc_field using 'J_STMAINT-ANWS(02)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(03)'.
perform bdc_field using 'J_STMAINT-ANWS(02)'
perform bdc_field using 'J_STMAINT-ANWS(03)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'J_STMAINT-ANWS(04)'.
perform bdc_field using 'J_STMAINT-ANWS(03)'
perform bdc_field using 'J_STMAINT-ANWS(04)'
'X'.
perform bdc_dynpro using 'SAPLBSVA' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'BDC_CURSOR'
'JOSTD-OBJNR'.
perform bdc_dynpro using 'SAPMV45A' '4002'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-TXT_VBELN'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'VBKD-BSTKD'
'open SO'.
perform bdc_field using 'VBKD-BSTDK'
'29.01.2008'.
perform bdc_field using 'KUAGV-KUNNR'
'100000'.
perform bdc_field using 'KUWEV-KUNNR'
'100000'.
perform bdc_field using 'RV45A-KETDAT'
'29.01.2008'.
perform bdc_field using 'RV45A-KPRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'29.01.2008'.
perform bdc_field using 'VBKD-INCO1'
'EXW'.
perform bdc_field using 'VBKD-INCO2'
'mumbai'.
perform bdc_field using 'VBKD-ZTERM'
'0001'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_transaction using 'VA01'.
perform close_group.
if in excel file one row of records means i am succesfully creating SO.
But for multiple i am not getting idea to create SO.
My excel file details like this.In this excel file based on VBKD-BSTKD_E value i have to keep the records in line items.
VBAK-AUART :Order Type
VBAK-VKORG : Sales Org
VBAK-VTWEG : Distri Channel
VBAK-SPART : Division
VBAK-KUNNR : Sold-to-Party
VBPA-KUNNAR : Ship-to-Party
VBAK-BSTNK : PO No
VBAK-BSTDK : PO Date
VBAP-MATNR : Material No
A_THICK_MM
A_WIDTH_MM
A_EQUIVALENT_SPEC
A_COIL_INNER_DIA_MM
A_BATCH_WEIGHT_MIN_SI
A_BATCH_WEIGHT_MAX_SI
VBAP-KWMENG : Qty
VBAP-WERKS : Delivery Plant
VBKD-INCO2 : Incoterm2
VBKD-KONDA : Price Group
VBKD-VSART : Shipping Type
VBAK-TAXK1 : Cust Tax-1
VBAK-TAXK2 : Cust Tax-2
VBAK-TAXK3 : Cust Tax-3
VBAK-TAXK4 : Cust Tax-4
VBKD-ZLSCH : Payment Method
VBAP-TAXM1 : Mat tax clss-1
VBAP-TAXM2 : Mat tax clss-2
VBAP-TAXM3 : Mat tax clss-3
VBAP-TAXM4 : Mat tax clss-4
VBAP-POSEX : IMPS Order No
VBKD-BSTKD_E : old SO in 4.6c
VBKD-POSEX_E : old SO Item in 4.6c
Text Id : TDC No
Text Id-ES10 : Special Inst(Unld const & Veh)
ZOR,2000,10,5,100000,100000,PO NO 125,19.01.2008,HRPOCF,3.1,1200,IS_11513_GR_D_1985,610,20.084,20.084
51,2010,Mumbai,01Freight-pre paid,ER,2,0,L,0,c,1,1,0,0,108128,3011192, 1,PO 444 AMD 1,Spl Inst
based on VBKD-BSTKD_E line items has to create.
if VBKD-BSTKD_E = 3011192 is like 4 records in excel means for these 4 should be one SO
if it is changed to 3011193 then only different SO.
PLs If any one knows solution pls write some sample code for me.
If u send that code to my mail id also very thankful.
Pls help me this is urgent requirement.
[email protected]
Thanks & Regards,
J.LokeshIf u want to add Items data, u have to handle the Table control by writing the complete code.
U have to write code for 2 items, when u press enter u will get new row to enter new record one by one.
Narendra -
Sales order: How to add pricing conditions at item level in BDC of VA01
Hello Experts,
Am writing BDC for sales order, in this process I need to add ITEM PRICING CONDITIONS, so, am selecting item and pressing the DOLLAR symbol button and am adding the conditions by pressing PLUS button in loop!! but am getting this erorr- Field KOMV-KMEIN (2) is not an input field!! when I execute it in we19-BACK GROUND only!! if I execute the same CODE IN we19-Fore ground, I dont have any issue!! I checked this SDN (field status in config), Google, but did not helped me!
Pls. let me know is there any other way to add conditions at item level in VA01 in BDC code?
THank youHi,
It is happening because the second row of the item level data screen is becoming display only. Please check whether In foreground mode you are pressing an extra enter to give data in the second row of the item level data after giving data in the first row and in BDC recording you have not recorded that 'Enter'.
Regards,
Gargi
Maybe you are looking for
-
I recently downloaded Firefox 13.0.1.. For the past several days the minimize, maximize, and exit buttons located in the top right hand corner have been non functional almost immediately upon starting a browser session. I have tried disabling plugins
-
Flash Player Install won't ever proceed beyond 25% on Mavericks
Hi, I've been using Chrome as my browser forever, but my newest work software requires me to use a 64-bit browser. I still have Chrome installed (not default though), and I've tried installing Flash Player on both Firefox and Safari. Both seem to wor
-
Safari HTTPS Firewall Proxy Problem...
Hi everyone, I am having a problem at work with safari. First of all, browsers like firefox, camino, and opera work fine. Browsers like Safari, Shiira, and Sunrise Browser cannot open https sites properly. I am always asked to type in username and pa
-
Spackle.dll failing to load in Reflector
I'm working on decompiling a source code in .NET reflector 7.4 however, when I try to add Spackle.dll to my Add-Ins list along with FileGenerator.dll I get the following Error: The following add-ins failed to load: C:\FileGenerator\Spackle.dll Syste
-
Should I remove CS4 after installing CS6?
I upgraded to CS6, yet my CS4 programs are still on my computer. Do I need to manually delete them? And if yes, will all my files created with CS4 remain functional on my computer with the CS6 update?