Ship to party at line item using BAPI_BUSPROCESSND_CREATEMULTI
Hi all,
I am using BAPI_BUSPROCESSND_CREATEMULTI to create a sales order in CRM. The sales order is successfully generated in CRM.
I am inputting Sold to party, Ship to part, bill to and payer at header level. I am also inputting different ship to party for each line item.
But when i create the order, i observe that every line item is having the same ship to party that i provide for order header. i.e ship to party at header is being copied to each line item...but i dont want that to happen..i want to give a different ship to party at each line item.
I used the crm_order_read report to find out how partner table is filled and incorporated the same in my code....
still i am unable to populate different ship to party at line item level
here is my code...i had been trying to figure this out since 3 weeks and i am unable to find out why i am unable to put different ship to party for each line ite m.....
some one please help me if they encountered this earlier...
kindly help..this is my sample code
Ship to at header level
ls_logical_key-ref_partner_handle = '0002'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
_set_field ls_partner REF_GUID lv_guid_h.
_set_field ls_partner REF_KIND 'A'.
_set_field ls_partner KIND_OF_ENTRY 'C'.
_set_field ls_partner PARTNER_FCT '00000002'.
_set_field ls_partner PARTNER_NO wa_header-SHIP_TO .
_set_field ls_partner NO_TYPE 'BP'.
_set_field ls_partner DISPLAY_TYPE 'BP'.
_set_field ls_partner MAINPARTNER 'X'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
Ship to at item level
ls_logical_key-ref_partner_handle = '0002'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_i.
ls_input_fields-ref_handle = lv_handle_i.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_i.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
_set_field ls_partner REF_GUID lv_guid_i.
_set_field ls_partner REF_KIND 'B'.
_set_field ls_partner KIND_OF_ENTRY 'C'.
_set_field ls_partner PARTNER_FCT '00000002'.
_set_field ls_partner PARTNER_NO wa_item-SHIP_TO .
_set_field ls_partner NO_TYPE 'BP'.
_set_field ls_partner DISPLAY_TYPE 'BP'.
_set_field ls_partner MAINPARTNER ' '.
Some one please help me and tell me what i am missing...
regards,
Jessica Sam
Edited by: jessica sam on May 10, 2009 10:52 PM
Edited by: jessica sam on May 10, 2009 10:52 PM
Edited by: jessica sam on May 10, 2009 10:53 PM
Edited by: jessica sam on May 10, 2009 10:54 PM
I know how to trace the Ship to party at line item. When i create an order manually on CRM then the table CRMD_PARTNER has the required entries and the Ship to party at line item is getting populated correctly. Also if i open the order in CRMD_ORDER the ship pto party are being populated correctly at line item..
But if i am trying to replicate this programatcally using the BAPI, i see that the ship to at header is being copied to each line item and this is not what is expected.
If i go and check in the CRMD_PARTNER the data is not filled
correctly as I dont have any ship to party at line item
So finally I even tried to insert the data manually in the CRMD_PARTNER table using an
INSERT statement and even that doesnt work...
https://www.sdn.sap.com/irj/scn/forums
So i am unable to ficgure out what is going wrong
Any body if they have any idea on poulating ship to party programatically in
sales order for each line item please help
I am unable to figure out how to fill PArtner table of this BAPI to populate ship to at line item level
Kindly Help..
Regards,
Jessica Sam
Similar Messages
-
Ship to party for each material using BAPI_SLSTRANSACT_CREATEMULTI
i am able to generate sales order for in CRM. I am inputting the sold to party, ship to party, bill to party and payer at the header level...
CRM is currently configured in such a way that , there is a provision to assign ship to party at item level for each material.
How can i programatically replicate this? I need to assign a diiferent ship to party for each material in the sales order.*
how can i programatically replicate this?...
this is my code for cresating a sales order in CRM with sold to party, ship to party, bill to party and payer at the header level...
*************include constants
include crm_direct.
************// GUIDs
data: lv_guid_h type GUID_32, "HEADER GUIDE
lv_guid_i type GUID_32, "ITEM GUIDE
lv_guid_sl type GUID_32, "SCHEDULE LINE GUIDE
lv_guid_p type GUID_32. "PARTNER GUIDE
***********// Handles
data: lv_current_handle type crmt_handle, "CURRENT HANDLE
lv_handle_h type crmt_handle, "HEADER HANDLE
lv_handle_i type crmt_handle, "ITEM HANDLE
lv_handle_sl type crmt_handle, "SCHEDULE LINE HANDLE
lv_handle_p type crmt_handle. "PARTNER HANDLE
***********// Administration header + item + etc
data: lt_salesorder_header type table of bapibus20001_header_ins, "LT_SALESORDER_HEADER
ls_salesorder_header type bapibus20001_header_ins, "LS_SALESORDER_HEADER
lt_salesorder_item type table of bapibus20001_item, "LT_SALESORDER_ITEM
ls_salesorder_item type bapibus20001_item, "LS_SALESORDER_ITEM
lt_scheduleline type table of BAPIBUS20001_SCHEDLIN, "LT_SCHEDULELINE
ls_scheduleline type BAPIBUS20001_SCHEDLIN, "LS_SCHEDULELINE
lt_partner type table of BAPIBUS20001_PARTNER_INS, "LT_PARTNER
ls_partner type BAPIBUS20001_PARTNER_INS, "LS_PARTNER
ls_logical_key TYPE crmt_partner_logic_partner_key, "LS_LOGICAL_KEY
lt_organisation type table of BAPIBUS20001_ORGMAN_INS, "LT_ORGANISATION
ls_organisation type BAPIBUS20001_ORGMAN_INS. "LS_ORGANISATION
*********// Saved sales orders
data: lt_saved_process type table of bapibus20001_object_id, "LT_SAVED_PROCESS
data:
ls_saved_process type bapibus20001_object_id, "LS_SAVED_PROCESS
ls_salesorder type CRMT_RETURN_OBJECTS_STRUC. "LS_SALESORDER
data: lt_input_fields type table of bapibus20001_input_fields, "LT_INPUT_FIELDS
ls_input_fields type bapibus20001_input_fields, "LS_INPUT_FIELDS
ls_return type bapiret2. "LS_RETURN
data: lt_return type table of bapiret2. "LT_RETURN
***********// Macro definition to populate structure and input field This, called as
*_set_field ls_salesorder_header GUID lv_guid_h
*is exploded as
ls_salesorder_header-GUID = lv_guid_h.
ls_input_fields-fieldname = 'GUID'.
append ls_input_fields to lt_input_fields.
*Note 1: &2 (field name) MUST be uppercase
*Note 2: for the salesorder header, Macro has not been used to show how the code should look like.
*except for that the macro has been used everywhere else.
define setfield.
&1-&2 = &3.
ls_input_fields-fieldname = '&2'.
append ls_input_fields to lt_input_fields.
end-of-definition.
*****// end of macro definition
******// fill order administration header
perform get_guid changing lv_guid_h.
add 1 to lv_handle_h.
ls_salesorder_header-guid = lv_guid_h.
ls_salesorder_header-handle = lv_handle_h.
ls_salesorder_header-process_type = 'ZWEB'.
clear ls_input_fields.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_guid = lv_guid_h.
*ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-orderadm_h.
ls_input_fields-fieldname = 'GUID'.
append ls_input_fields to lt_input_fields.
ls_input_fields-fieldname = 'HANDLE'.
append ls_input_fields to lt_input_fields.
ls_input_fields-fieldname = 'PROCESS_TYPE'.
append ls_input_fields to lt_input_fields.
append ls_salesorder_header to lt_salesorder_header.
**********// fill organisation data (Interface needs this, some times may rely on sales org determination instead...
clear ls_input_fields.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-orgman.
setfield ls_organisation REF_GUID lv_guid_h.
setfield ls_organisation REF_HANDLE lv_handle_h.
setfield ls_organisation REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_organisation SALES_ORG_RESP SO_RESP . "(input).
setfield ls_organisation SALES_ORG SALES_ORG. "(input).
setfield ls_organisation DIS_CHANNEL DIS_CHNL. "(input).
setfield ls_organisation DIVISION DIVISION. "(input).
append ls_organisation to lt_organisation.
**********// fill order administration item
perform get_guid changing lv_guid_i.
lv_handle_i = lv_handle_h.
add 1 to lv_handle_i.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_i.
ls_input_fields-ref_handle = lv_handle_i.
*ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_i.
ls_input_fields-objectname = gc_object_name-orderadm_i.
setfield ls_salesorder_item GUID lv_guid_i.
setfield ls_salesorder_item HEADER lv_guid_h.
setfield ls_salesorder_item HANDLE lv_handle_i.
setfield ls_salesorder_item HEADER_HANDLE lv_handle_h.
setfield ls_salesorder_item ORDERED_PROD PRODUCT . "(input).
setfield ls_salesorder_item ITM_TYPE 'ZTAN'.
setfield ls_salesorder_item MODE 'A'.
*adjustment taken from standard include LCMS_MAPPERF04
*(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
delete lt_input_fields where fieldname = 'HANDLE'
OR
fieldname = 'HEADER_HANDLE'.
append ls_salesorder_item to lt_salesorder_item.
********// fill schedule line for item
perform get_guid changing lv_guid_sl.
add 1 to lv_handle_sl.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_i.
ls_input_fields-ref_handle = lv_handle_i.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_i.
ls_input_fields-objectname = gc_object_name-schedlin.
setfield ls_scheduleline ITEM_GUID lv_guid_i.
setfield ls_scheduleline GUID lv_guid_sl.
setfield ls_scheduleline HANDLE lv_handle_sl.
setfield ls_scheduleline ITEM_HANDLE lv_handle_i.
setfield ls_scheduleline QUANTITY quantity. "(input).
append ls_scheduleline to lt_scheduleline.
********// fill partner line
*perform get_guid changing lv_guid_p.
*the partner use the logical key as well
ls_logical_key-ref_partner_handle = '0001'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0001'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000001'.
setfield ls_partner PARTNER_NO SOLD_TO. "(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
ls_logical_key-ref_partner_handle = '0002'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0002'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000002'.
setfield ls_partner PARTNER_NO SHIP_TO . "(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
ls_logical_key-ref_partner_handle = '0003'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0003'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000003'.
setfield ls_partner PARTNER_NO BILL_TO ."(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
ls_logical_key-ref_partner_handle = '0004'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0004'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000004'.
setfield ls_partner PARTNER_NO PAYER ."(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
*******// example of a second partner function (custom) with data override
*ls_logical_key-ref_partner_handle = '0002'.
*clear ls_input_fields.
*ls_input_fields-ref_guid = lv_guid_h.
*ls_input_fields-ref_handle = lv_handle_h.
*ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
*ls_input_fields-objectname = gc_object_name-partner.
*ls_input_fields-logical_key = ls_logical_key.
*_set_field ls_partner REF_GUID lv_guid_h.
*_set_field ls_partner REF_HANDLE lv_handle_h.
*_set_field ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
*_set_field ls_partner REF_PARTNER_HANDLE '0002'.
*_set_field ls_partner KIND_OF_ENTRY 'B'. "manual entry...
*_set_field ls_partner PARTNER_FCT customFct(input).
*_set_field ls_partner PARTNER_NO bpNumber(input).
*_set_field ls_partner NO_TYPE 'BP'.
*_set_field ls_partner DISPLAY_TYPE 'BP'.
*_set_field ls_partner TITLE 'Mr.'.
*_set_field ls_partner FIRSTNAME 'John'.
*_set_field ls_partner LASTNAME 'Smith'.
*_set_field ls_partner STR_SUPPL1 'John Smith and Co'.
*_set_field ls_partner STREET 'Street1'.
*_set_field ls_partner STR_SUPPL3 'Street4'.
*_set_field ls_partner HOUSE_NO '42'.
*_set_field ls_partner CITY 'Townville'.
*_set_field ls_partner DISTRICT 'Districtshire'.
*_set_field ls_partner POSTL_COD1 'AA1 2BB'.
*note now ...
*adjustment taken from standard include LCMS_MAPPERF04
*(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
*I don't use macro because name of the field in input_table is different
*_set_field ls_partner COUNTRYISO 'GB'.
*instead
ls_partner-COUNTRYISO = 'GB'.
ls_input_fields-fieldname = 'COUNTRY'.
append ls_input_fields to lt_input_fields.
*_set_field ls_partner LANGU_ISO 'EN'.
ls_partner-LANGU_ISO = 'EN'.
ls_input_fields-fieldname = 'LANGU'.
append ls_input_fields to lt_input_fields.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
*Create sales orders *
call function 'BAPI_SLSTRANSACT_CREATEMULTI'
EXPORTING
testrun = false
TABLES
header = lt_salesorder_header[]
item = lt_salesorder_item[]
partner = lt_partner[]
organisation = lt_organisation[]
input_fields = lt_input_fields[]
scheduleline = lt_scheduleline[]
saved_process = lt_saved_process[]
return = lt_return[].
*************// get the GUID of the created object
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = lt_return1.
INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01.
Edited by: jessica sam on Dec 22, 2008 4:25 PM
Edited by: jessica sam on Dec 22, 2008 4:27 PM
Edited by: jessica sam on Dec 22, 2008 7:05 PM
Edited by: jessica sam on Dec 23, 2008 5:18 AMI know how to trace the Ship to party at line item. When i create an order manually on CRM then the table CRMD_PARTNER has the required entries and the Ship to party at line item is getting populated correctly. Also if i open the order in CRMD_ORDER the ship pto party are being populated correctly at line item..
But if i am trying to replicate this programatcally using the BAPI, i see that the ship to at header is being copied to each line item and this is not what is expected.
If i go and check in the CRMD_PARTNER the data is not filled
correctly as I dont have any ship to party at line item
So finally I even tried to insert the data manually in the CRMD_PARTNER table using an
INSERT statement and even that doesnt work...
https://www.sdn.sap.com/irj/scn/forums
So i am unable to ficgure out what is going wrong
Any body if they have any idea on poulating ship to party programatically in
sales order for each line item please help
I am unable to figure out how to fill PArtner table of this BAPI to populate ship to at line item level
Kindly Help..
Regards,
Jessica Sam -
VA01 : How to add field ship to party to tab Item Overview
Standard SAP is filling the ship to party on item level by default with the value entered on order header level. In case you added multiple items for an order and you want to change the ship to party for 1 or 2 items, you have to doubleclick on the line and then go to tab Partners and change the ship to party item by item by using the next and previous item button. We would like to add a column including the SH partnervalue to tab Item Overview (sapmv45a 4900) so we will be able to change the ship to party for an item on 1 screen. Is it possible to add a new colum (via a userexit / badi)?
kind regards
Angelique HeutinckSeems its not possible through standard SAP.we had the similar req in our project so what we did is we append the structure VBAP and added one new z field .... i reckon the same way you can do it for ur req as well.in short you need the access key.
Please do let me know if u fnd another way to fix the problem i mean without access key.
Best of luck
Jess -
Changing ship to address at line item level in CRM order
Hi All,
Is it posible to change the ship to address at line item level in CRM order either at the time of order creation or order change. if yes please let me know if we need to do any settings for this.
Thanks in advance.
JMI agree with the previous comment, Please go to the Partner Determination procedure attached to the Transaction and in the partner functions associated with the that procedure, find Ship-to-Party and there will be a check box to "make it changeable" once determined. Check that and save it.. You should be all set
Thanks
Raj -
Hi All,
Can anybody give me a clear concept of line items used in Infocube. I want to know what is the concept behind using the line items. How does it effect the performance of a Infocube.
Regards,
KshitijHi,
go throught the link, you will get a clear idea.
http://help.sap.com/saphelp_nw2004s/helpdata/en/a7/d50f395fc8cb7fe10000000a11402f/frameset.htm
rgrds,
v.sen. -
Purchase order ship to party no at item level
Hi All,
I am able to get Ship To Party Address from ADRC table(Iam getting ADRNR from EKPO) But my client requirement is to get the KUNNR and not the address.
Is there any way to get KUNNR based on ADRNR at item level .I have search through the (KNA1 , LFA1 , VBPA , EKPA , EKPV ) But I couldn't get the relationship (KUNNR).
Actually Iam not able to get who the Ship To Party is at item level.
If we take it as shipping address of the purchasing party i could't find it in T001W.Where as if it is header it is maintained in T001W.
Do we have to take it as Third Party Ship to Party (i.e purchasing for a third party and shipping it directly to them).
Can anybody help me on this.PLZ.This is very urgent.
Thanks,
Saritha.Hi,
Thank you for ur response.
ADRNR address value is not maintained in KNA1 table.
Thanks,
Saritha. -
Adding a new schedule line for a line item using bapi_po_change
hi experts,
can i know how to add a new schedule line for a line item using<u> bapi_po_change</u>. what are the parameters that need to be filed. i filled poitem with total quantities and poschedule table with 2 different schedule lines and passing as the parameter.but then i get the error saying item 0000 doesnt existHi,
Please check if you have properly populated the following fields in POSCHEDULE:
PO_ITEM
SCHED_LINE
and the other fields required for your schedule line such as delivery date and quantity, etc.
After that, make sure to properly populate fields in POSCHEDULEX:
PO_ITEM -> same value as found in POSCHEDULE
SCHED_LINE -> same value as found in POSCHEDULE
All other values populated in POSCHEDULE should be ticked as 'X' in POSCHEDULEX.
Kind Regards,
Darwin
Kind Regards,
Darwin -
How to add new line item using BAPI BAPI_CONTRACT_CHANGE for contract-ME32K
HI Experts,
how to add new line item using BAPI: BAPI_CONTRACT_CHANGE for existing contract.
Requirement:
Already the contract having two line items using ME31K.
Custom program has to add new line items in existing contract.
Thanks,
SendilI got the solution:
We can do like this:
1. Get all details using details, BAPI_CONTRACT_GETDETAIL.
2. After getting results, append new line item. Then use your BAPI.
Check this posting program.. where this bapi is used, use the same coding technique.
IDOC_INPUT_PURCONTRACT_CHANGE -
Adding a new line item using BAPI_OUTB_DELIVERY_CHANGE
Hi,
I have a requirement to add a new line item to outbound delivery to the existing line items using the FM BAPI_OUTB_DELIVERY_CHANGE.Pls suggest how to do it.
Thanks in advance.
AnandHi,
Did you Check IN SCN like [THIS|Re: BAPI_OUTB_DELIVERY_CHANGE Help - Add new line item].
Regards,
Rahul -
Ship-to party details at item level
Hi friends,
I am using SAP version 4.7. In a sales order, Ship-to party is different at header level and item level. When I go to the sales order item overview and click on a particular item and in the partners tab, I see a different customer under ship-to party partner function. The problem here is that though the partner no. is different, details such as name, street are getting picked from header level ship-to-party. Suppose, at header level, ship-to party is '1', and at item level ship-to party is '2'. In the details of ship-to party at item level, I am getting '1's name and street details.
I have checked OSS notes but,could not find any relevent note for my sap version and package,
Please suggest what could be the solution.
Thanks & Regards,
Vishnu PriyaHi Vishnu,
In sales, ship-to party is never mentioned in header..( u can chk out in table VBAK-->header sales table)..only sold-t party is mentioned..this is because one sale can have many different consignees for different items but for the same customer... also, ship-to party can also be same as te sold-to party...so that may be the reson u r getting the same address for both...
hope it helps,
Regards,
Bikash -
Creation of po with mutiple line items using BDC
Hi Gurus,
Can any body hav notes for creating po's using BDC with multiple line items in transaction ME21. I hav created po for single line item but if i tried to create multiple line items, it ll create multiple po's...
thanks in advance
arunSee the Below Logic for me22 and it is also same for me21
report zpochange.
data : i_error like bdcmsgcoll occurs 0 with header line.
data : i_bdcdata like bdcdata occurs 0 with header line.
tables : ekko, ekpo.
data :c1(10) value 'ME22',
c2(1) value ',',c3(10).
data : var1(20). " LIKE EKKO-EBELN.
data : var2 like ekko-ebeln.
data : begin of i_ekko occurs 0,
header(2),
ebeln like ekko-ebeln,
end of i_ekko.
data : begin of i_ekpo occurs 0,
item(2),
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
menge(10), " LIKE EKPO-MENGE,
end of i_ekpo.
data : v like ekpo-ebelp.
data: begin of itab occurs 0,
text(300),
end of itab.
parameters: p_file like ibipparms-path.
*PARAMETERS: PONUMBER LIKE EKPO-EBELN.
at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
FIELD_NAME = ' '
importing
file_name = p_file
start-of-selection.
*SELECT EBELN FROM EKKO INTO TABLE I_EKKO WHERE EBELN = PONUMBER.
SELECT EBELN EBELP MENGE FROM EKPO INTO TABLE I_EKPO WHERE EBELN
*= PONUMBER.
perform get_data.
*LOOP AT ITAB.
WRITE :/ ITAB.
ENDLOOP.
loop at itab.
var1 = itab-text+0(1).
if var1 = 'H'.
*I_EKKO-EBELN = ITAB-TEXT.
split itab at c2 into i_ekko-header
i_ekko-ebeln.
SPLIT ITAB AT ',' INTO I_EKKO-EBELN.
" I_EKPO-EBELP
" I_EKPO-MENGE
" var1.
append i_ekko.
else.
split itab at c2 into i_ekpo-item
i_ekpo-ebeln
i_ekpo-ebelp
i_ekpo-menge.
append i_ekpo.
endif.
*var2 = i_ekpo-ebeln.
MOVE VAR1 TO I_EKPO-EBELN.
MOVE VAR1 TO I_EKKO-EBELN.
APPEND: I_EKPO.
*if not var1 is initial.
split var1 at ',' into i_ekpo-ebelp
i_ekpo-menge.
i_ekpo-ebeln = var2.
append i_ekpo.
*endif.
endloop.
loop at i_ekpo.
write :/ i_ekpo.
endloop.
loop at i_ekko.
perform fill_data. " TABLES I_EKPO.
endloop.
LOOP AT I_EKPO.
WRITE :/ I_EKPO.
ENDLOOP.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
*LOOP AT I_ERROR.
WRITE :/ I_ERROR.
ENDLOOP.
form get_data.
call function 'WS_UPLOAD'
exporting
codepage = ' '
filename = p_file
filetype = 'ASC'
headlen = ' '
line_exit = ' '
trunclen = ' '
user_form = ' '
user_prog = ' '
dat_d_format = ' '
IMPORTING
FILELENGTH =
tables
data_tab = itab
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " GET_DATA
*& Form FILL_DATA
text
-->P_I_EKPO text
form fill_data. " tables i_ekpo .
perform bdcscreen using 'SAPMM06E' '0105'.
perform bdcfield using 'RM06E-BSTNR' i_ekko-ebeln.
perform bdcfield using 'BDC_OKCODE' '/00'.
loop at i_ekpo where ebeln = i_ekko-ebeln.
V = I_EKPO-EBELP.
perform bdcscreen using 'SAPMM06E' 0120.
perform bdcfield using 'BDC_CURSOR' 'RM06E-EBELP'.
perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.
perform bdcfield using 'BDC_OKCODE' '/00'.
perform bdcscreen using 'SAPMM06E' 0120.
perform bdcfield using 'BDC_CURSOR' 'EKPO-MENGE(01)'.
perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.
perform bdcfield using 'EKPO-MENGE(01)' i_ekpo-menge.
perform bdcfield using 'BDC_OKCODE' '/00'.
*PERFORM BDCSCREEN USING 'SAPMM06E' 0120.
*PERFORM BDCFIELD USING 'BDC_CURSOR' 'RMO6E-EBELP'.
*CLEAR V.
endloop.
perform bdcfield using 'BDC_OKCODE' '=BU'.
call transaction c1 using i_bdcdata mode 'A'
messages into i_error.
refresh i_bdcdata.
endform. " FILL_DATA
*& Form BDCSCREEN
text
-->P_0140 text
-->P_0120 text
form bdcscreen using p_program p_screen.
i_bdcdata-program = p_program.
i_bdcdata-dynpro = p_screen.
i_bdcdata-dynbegin = 'X'.
append i_bdcdata.
clear i_bdcdata.
endform. " BDCSCREEN
*& Form BDCFIELD
text
-->P_0145 text
-->P_I_EKPO_EBELN text
form bdcfield using fnam fval.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
append i_bdcdata.
clear i_bdcdata.
endform. " BDCFIELD
Reward Points if it is helpful
Thanks
Seshu -
How to make plant in shipping cond tab for line item in sales doc mandatory
Hi
How to make plant as mandatory for a sales document say quotation mandatory ? I went to SPRO-> Basic Fucntion - > log of incomplete terms -> Define incomplete Groups -> B.selected sales -Item -> Created new procedure Z001 with fielda VBAP - WERKS ,selected screen name PDE2 and checked warning check box.
When i goto Assign incompleteness procedures I donot have option to assign it sales document item level procedure i will only get sales doc header procedure to assign it to document type quotation.
How to make plant as mandatory for each line item in quotation?
Thanks,
VaishnaviInclude: MV45AFZB
Form USEREXIT_CHECK_VBAP
In our business scenario, we have used the same ,But Plant is mandatory only for 1st line item-
source code:
IF vbak-vkorg = '1000' OR vbak-vkorg = '2000'.
IF sy-tcode = 'VA31' OR
sy-tcode = 'VA11' OR
sy-tcode = 'VA21' OR
sy-tcode = 'VA41' OR
sy-tcode = 'VA01' .
IF vbap-werks IS INITIAL AND
vbap-posnr EQ '000010'.
MESSAGE e398(00) WITH 'Please enter the plant for first line'.
ENDIF.
ENDIF.
ENDIF.
Help:
Through this form exit we are making the "plant' field (for the ist &*
& line item ) mandatory for the sales document . This interns helps us &
& to create the sales document numner according to the plant (Region) &
*& of the Plant
Hope it clears. take assistance of your ABAPer. -
Creation of Blanket PO having Multiple Line items using Bapi_po_create1
Hi
How to create a Blanket Purchase ordetrs using Bapi BAPI_PO_CREATE1. The PO has multiple line items.
Regards
LakshmanMaybe this will help:
[blanket purchase order (MM)|http://help.sap.com/saphelp_srm30/helpdata/en/35/26c019afab52b9e10000009b38f974/content.htm]
Rob -
Not able to clear an open line item using F-44
Hi Experts,
I am trying to clear open line items of a document using F-44. But I am getting message "No appropriate line item is contained in this document". The open line item document is available in BSIK table also. Please help me out here.
Regards
Amit kumar- Check some table fields in the missing documents using Transaction SE16. The following conditions must exist for the missing document numbers in question -
BSIS-XOPVW = X (Indicator: Open item management, only for G/L accounts)
BSEG-XOPVW = X (Indicator: Open item management)
BSEG-AUGBL = space (clearing document number)
BSEG-DISBN = space (discount document number)
BKPF-BSTAT = space (document status)
BKPF-XSTOV = space (indicator reversal flag)
REGUS/REGUP -> see below
- Check Note 136754 - F-03, F-32, F-44, F-28 missing open items (link below)
Note 136754
[https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=136754]
Rgds. -
How to input FI invoice with many line items using FB60
Dear All,
Currently the users are posting document consisting of 500 to 700 line items every period using transaction FB60. The line items that are posted every period are not repetitive in nature. It is consuming lot of time.
Is there any efficient (simpler) way of posting the document with so many line items? could you please share your thoughts in this regard?
Thanks & Regards
VasuHi Vasu,
Try to do a recording for a BDC program with Tcode SHDB.
Then ask your ABAPer to developa program with this BDC recording.
This will fix the purpose.
Thanks,
Srinu.
Maybe you are looking for
-
Different page sizes in same article or folio
Hi Is it possible to have pages with different sizes in the same article or articles with different sizes inside a .folio? I saw something like this in last edition of Wired magazine in the Table of content (4th article) and Wired.com section (6th a
-
My iphone has no service but do i need service to set up messages? I have tried restoring, everything i can do. but i just wont work. but if i do turn it on on verizon will i be able to activate messages?
-
How do i add a website as trusted in safari
How do I add a trusted site in Safari? I need to add my work websites.
-
I am working on an Oracle 10.2.0.3 database housed in a sun solaris OS. There are 2 tablespaces DEFAULT_DATA and NONDEFAULT_DATA for users to create objects. User HARPER has a default tablespace of DEFAULT_DATA assigned to him only to which he has a
-
hello everyone i am new to arch and all wiki entries, threads, google and #archlinux didnt help me. i want sound through hdmi, i am using a radeon 4550 (xf86-video-ati, R700 is in the feature matrix) some outputs: lsmod only has things on snd-hda-int