Append New Line Item(s) onto the created Purchase Request using Function
Dear Expert,
I am trying to append new lines into the created purchase request via Function Module/ BAPI.
Say, now, the Purchase Request has already 1 line item. And i want to append new line items into
this purchase request via function module/ bapi.
Do you know if there is any function module/ bapi exists to do this?
Thanks.
Tee
Hi,
It's weird.
I tried on the BAPI_PR_CHANGE, and the return message says that it has successfully changed the PR. But, when i see it via ME53N, it's not being updated.
Does anyone has sample usage/ code using this BAPI?
Thanks.
Tee
Similar Messages
-
Hi All,
My requirement is to add new line items automatically onto the shopping basket based on a main configurable line item addition.
Unfortunately this could not be configured for a variety of reasons.
This has to done after the user clicks on Accept on the config pop-up for this Part and before he returns to the shopping basket.(I believe the CRM_ISA_BASKET_CHANGE would be called at this point)
ISA would pass to the backend the extension values for the new Material to be added and the Main item(config item number) in the function call.
So technically what would be best approach to add new line items and tie it to a parent line item if ISA can send both the values(new Material/Parent Product) in extension table to the backend?
Did someone face this situation before. If yes can you please let me know which methods in the backend were used?
Thanks a lot.Hi,
May I know how did you resolve this problem.
Thanks in advance.
amar.s -
Addition of new line line items in delivery while creating
HI All,
i have the requirement of adding a new line item in delivery items while creating it referencing a sales order.
i have to add new line item based on the existing line items. i have done coding in badi save_doc_prepare.
now new line items are getting added but we are not getting values in all the fields which are determined by SAP.
because after badi save_doc_prepare sap does not determine the values for newly added fields.
can anybody suggest some good solution.
thanks
Rajpal Sehrawattry this BAPI BAPI_PO_CREATE
-
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 new line item directly to PO
Hi,
We have a requirement for adding a new line item directly within the Purchase Order in SRM (without using the shopping cart). We are using the FM BBP_PD_PO_UPDATE for this purpose. However, we are getting the following error while updating. " BUFFER TABLE NOT UP-TO-DATE". Please provide assistance in order to resolve this issue.
Regards,
ArunWe achieved based on the Security roles to identify if the user is Requester or Purchaser or Manager and Webdynpro changes by the portal team to activate the Change and Order button based on the required business rules.
Transaction Code for PO Change to be added to the security role.
Requisitioner: Any user with out any existing A012 relationship with any existing Organizational units on the current date:
Manager: Any user having A012 relationship with any existing Organizational units on the current date.
If the Authorization object checked programmatically results the value of "PUR" then the standard SAP code for "Purchaser" has to be executed.
Some additional Info :
Control list of PO using BADI BBP_WF_LIST - Change Work lists and Search Results Lists Method: BBP_WF_LIST
Badi -BBP_AUTHORITY_CHECK for any additional authorisation checks
Hope this helps.
Thanks
Balaji -
Create new line item while saving a new order
I have a requirement to create a new line item with different item category while creating an order.
i.e
if the item category is ICT1, then create a new line item like item 1 but with item category ICT2.
Also in the conditions tab, we need to update the condition type with different values for both existing and new item.
All this has to be in VA01 i.e on save.
I tried to append lines of structure XVBAP at SAVE_DOCUMENT _PREPARE by changing the item no and item caegory. This works fine. But, how can I get other table details like XKOMV(which stores pricing condition details) for the new item?
Please can you suggest any other exit/subroutine for this?
or any other alternative solutionsHi,
Try to use this EXIT:
'EXIT_SAPMM06E_013' Update Customer's Own Data in Purchasing Document
The Badi and exit contains same parameter.
Thanks,
AMS -
Add New Line item while creating a new PO in ME21N
Hi All,
I have a requirement to add a new line item when user is pressing enter on the Line item 1 based on some condition.
I am using the BADI 'ME_PROCESS_PO_CUST' and Method is 'PROCESS_ITEM'.
I have tried lots of options and also look for method 'Create_Item ' but not able to understand what exactly I need to pass in that method.
Can somebody elaborate on it if somebody has work on it? Even sample code will also help me.
Thanks in advance.
With regards
Sachin GuptaHi Sachin,
Please find the sample code :
METHOD if_ex_me_process_po_cust~process_item .
DATA: ls_mepoitem TYPE mepoitem,
ls_customer TYPE mepo_badi_exampl,
ls_tbsg TYPE tbsg.
* here we check customers data
ls_mepoitem = im_item->get_data( ).
IF ls_mepoitem-loekz EQ 'D'.
* a physical deletion of the item was carried out. therrefor we have to
* delete customer data on the level of the item
ls_customer-ebeln = ls_mepoitem-ebeln.
ls_customer-ebelp = ls_mepoitem-ebelp.
CALL FUNCTION 'MEPOBADIEX_SET_DATA'
EXPORTING
im_data = ls_customer
im_physical_delete_request = 'X'.
ELSE.
* update/insert operation
CALL FUNCTION 'MEPOBADIEX_GET_DATA'
EXPORTING
im_ebeln = ls_mepoitem-ebeln
im_ebelp = ls_mepoitem-ebelp
IMPORTING
ex_data = ls_customer.
* check customers data
* check field badi_bsgru. This should be carried out only for new items. Once the PO is posted the
* field should no longer be changeable. This is done in Method FIELDSELECTION_ITEM.
IF im_item->is_persistent( ) EQ mmpur_no.
IF ls_customer-badi_bsgru IS INITIAL.
* Place the cursor onto field badi_bsgru. The metafield was defined in BAdI ME_GUI_PO_CUST,
* Method MAP_DYNPRO_FIELDS.
mmpur_metafield mmmfd_cust_01.
mmpur_message_forced 'W' 'ME' '083' text-002 '' '' ''.
ELSE.
* check whether the field is valid
SELECT SINGLE * FROM tbsg INTO ls_tbsg WHERE bsgru EQ ls_customer-badi_bsgru.
IF NOT sy-subrc IS INITIAL.
mmpur_metafield mmmfd_cust_01.
mmpur_message_forced 'E' 'ME' '083' text-004 '' '' ''.
* invalidate the object
CALL METHOD im_item->invalidate( ).
ENDIF.
ENDIF.
ENDIF.
Try to check the import and export paremeters to pass the vales.
I hope this may helpfull.
Thank you,
Thanks,
AMS -
Copy service line items to new line items in the same contract (ME32K)?
Hello friends,
Requirement: There are many contracts (account assignment K) has service line items (type 9). I need to copy a contract line item along with its service line items (1 or more) into a new line item in the same contract. I tried bapi_po_change but it says Contracts can't be processed with it, as only in this bapi we have a structure for ESLL services. BAPI_CONTRACT_CHANGE or create don't have structure for ESLL..how to achieve this through a bapi or a fm?
So, in what way I could accomplish this? I came across some threads, which was helpful, but is not solving the purpose
Any guidance here would be of great help.
Thanks in advance.
MayankUse BAPI_AGREEMENT_MAINTAIN
This BAPI can be used to create new service items in the contract but won't change existing lines. You can query the contract lines that you want to copy and later call the BAPI to recreate them -
XVBAP has the new line item but does not update Sales Order
Hi
I need to update the sales order with a new line item when the line item has a base unit of measure as the sales unit. I need to then convert the base unit to sales unit with a whole figure and the rest can be in the base unit.
I am able to see the update in the xvbap but the line item doesn't get updated.
I am puting this code in a perform within
MV45AFZB within Form USEREXIT_CHECK_VBAP
But I guess I am doing something wrong can someone please take a look at it and tell me what is wrong with the coding.
*& Include ZSD_CREATE_NEW_LINE_ITEM *
*& Form create_new_line_item
text
--> p1 text
<-- p2 text
FORM CREATE_NEW_LINE_ITEM .
CONSTANTS: C_MEINH LIKE MARM-MEINH VALUE 'CSE'.
Variables Used
DATA: WS_WMENG LIKE VBEP-WMENG.
DATA: INPUT LIKE VBAP-KWMENG,
WS_EA LIKE VBAP-KWMENG,
WS_CSE LIKE VBAP-KWMENG.
DATA: WS_MVKE_VRKME LIKE MVKE-VRKME.
Internal Tables and Structures
DATA: WS_XVBAP LIKE XVBAP.
DATA:
it_vbap LIKE vbap OCCURS 0 WITH HEADER LINE,
it_vbep LIKE vbep OCCURS 0 WITH HEADER LINE,
it_xvbap LIKE vbapvb OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF WS_MARM,
MEINH LIKE MARM-MEINH,
UMREZ LIKE MARM-UMREZ,
UMREN LIKE MARM-UMREN,
END OF WS_MARM.
CLEAR WS_MVKE_VRKME.
SELECT SINGLE VRKME INTO WS_MVKE_VRKME
FROM MVKE
WHERE MATNR EQ XVBAP-MATNR
AND VKORG EQ XVBAK-VKORG
AND VTWEG EQ XVBAK-VTWEG.
IF VBAP-VRKME <> WS_MVKE_VRKME.
LOOP AT XVBAP.
SELECT SINGLE MEINH UMREZ UMREN
FROM MARM
INTO WS_MARM
WHERE MATNR = VBAP-MATNR
AND MEINH = WS_MVKE_VRKME.
IF XVBAP-MEINS <> WS_MVKE_VRKME.
IF NOT XVBAP-KWMENG = 0.
WS_WMENG = XVBAP-KWMENG / WS_MARM-UMREZ.
IF WS_WMENG > 1.
This means that the line item needs to be split into CSE & EA
INPUT = XVBAP-KWMENG.
WS_EA = INPUT / WS_MARM-UMREZ.
WS_CSE = WS_EA.
WS_EA = WS_CSE * WS_MARM-UMREZ.
WS_EA = INPUT - WS_EA.
Now we have the qty. split into EA & CSE. Now to
assign it to xvbap
XVBAP-KWMENG = WS_EA.
XVBAP-VRKME = WS_MVKE_VRKME.
READ TABLE XVBAP WITH KEY POSNR = XVBAP-POSNR.
MODIFY XVBAP INDEX SY-TABIX.
WS_XVBAP = XVBAP.
WS_XVBAP-KWMENG = WS_CSE.
MOVE-CORRESPONDING WS_XVBAP TO XVBAP.
INSERT XVBAP INDEX SY-TABIX.
ENDIF.
ENDIF.
ENDIF.
ENDIF. " IF xvbap-vrkme 'EA'.
ENDFORM. " create_new_line_itemHi Clark,
Pls check the Include MV45AFZZ instead of the one which you are using . Here in this include MV45AFZZ you can have access to the Header and Line items data .
Here in this include
FORM USEREXIT_SAVE_DOCUMENT *
This userexit can be used to save data in additional tables *
when a document is saved. *
If field T180-TRTYP contents 'H', the document will be *
created, else it will be changed. *
This form is called at from form BELEG_SICHERN, before COMMIT *
form userexit_save_document.
Endform.
Either you can write the code you want to update the XVABP table here or you can use the form .
FORM USEREXIT_MOVE_FIELD_TO_VBAP *
This userexit can be used to move some fields into the sales *
dokument item workaerea VBAP *
SVBAP-TABIX = 0: Create item *
SVBAP-TABIX > 0: Change item *
This form is called at the end of form VBAP_FUELLEN. *
form userexit_move_field_to_vbap.
endform.
This are the 2 performs in this include where you can do you code and it will defnitely solve your problem.
Good Luck to you . Let me know if your problem get solved.
Thanks & Regards,
Naidu. -
Reconfigure sales BOM deletes line item and creates new line item
We are having issue with Sales BOM. Once sales BOM is reconfigure, line item is automatically deleted and creates new line item. These changes are not captured by reporting tool. Is it standard SAP behavior? if its not standard behavior, how to fix this issue?
Hi,
If i am not wrong, i assume you are using site instead of plant. If it is plant , then "yes", we can have a order with same material being line item 10 and 20 with different plants. Reg delivery, if the plants are configured to a same shipping point then you will have one delievery. if the plants are configured for a different shipping point , then delivery will be split up.
Reward if it helps,
Thanks & regards,
CLN -
New Line Item to be created in sale order
Hi,
Client requires a new line item to be created in sale order for particular regions only..
Scenario 1 :
For a particular region Additional Tax shud be calculated on Basic Price .
Scenario 2 :
For a particular region Cess on Vat need to incorporated.
Client wants to maintain condition records in Cond Type :UTXJ and also the client shall maintain a 2 different Tax Codes for above each scenarios, In future in case Additional Tax or Cess on Vat is applicable to other regions it shud get posted in their respective G/L's
Plz suggest...
Thanx...It would be wonderful had you shared your suggestion in this forum itself rather sending to personal mail ids which is against the rules and regulations of this forum.
I request you to dont do that please. -
Adding new line item to the Purchase Requisition
Hi Guys,
I have created the PR using the BAPI_PR_CREATE. Now I want to add the new line item to already created PR. I tried with BAPI_PR_CHANGE and BAPI_REQUISITION_CHANGE but nothing worked for me.
Can anyone help me in this.
Thanks in advance
Edited by: jayakrishna.k on Feb 16, 2011 12:07 PMHi,
Please try MEMASSRQ or change by ME52N
Regards,
Manish Jain -
How do i create a new line item (say 20) in reference to line item 10
Hi all,
I am trying to map a scenario where i want to create a new line item with reference to an existing line item. Where do i get this option in SD, and how could i go about it?
Thanks & Regards
Ravi> In ECC6 if u go to VA01 and enter the SP and SH,
> Press Propose Item Icon, then one window will pop-up
> asking for Sale Document Number, enter the Number and
> select- selection list, there u will get all the
> line item of the Sale Doc. Select and copy Material
Hi i am on SAP 4.7. How could be the same handled here? -
ME21N add new line item when creating a PO
Hi guys,
I am new to badi & oop.
I want to add a PO line item after clicking the save button in ME21n.
I found the BADI IF_PURCHASE_ORDER_MM.
I have coded in the method POST by using method create_item.
However, it still does not work? Any ideas how to use this method to create the new line item or any sample code?
Please help! points will be rewarded.
Many thanks...Hi Sen,
You mean by executing the BAPI call? Maybe you did understand my question wrongly.
What my requirement is that, user will be keying in details for PO and its line item in ME21N.
And upon saving, need to auto add in an additional line to the PO. Eg user key in 3 line items, the BADI/userexit suppose to add a new line item to it.
The bapi that you proposed, creates PO from d scratch right?
I guess it can't just create an PO item with that bapi unfortunately.
Any other help? I need a help in coding this create_item method in interface class IF_PURCHASE_ORDER_MM.
Please help.. I have an urgent requirements.
Many thanks in advance. -
Create a new line item in sales order
Hi,
I have to create a new line item in a sales order. The scenario is that if we donot find the desired quantity from a plant. Then we have to go ahead and pick the remaining quantity from another plant and automatically create a new line item.The new plant is picked from a custom table so u need not worry about it.
According to me I will have to use the BAPI for it but one constraint is that while creating a sales order the order number assignment is not done until saved. So what can be done in the case if its a new document.
Kindly let me know if there is any appropriate user exit or if someone has worked on a similar requirement.
thanks
VarunHi,
Thanks for your response. I have tried to use these exits already but the problem dat comes here is dat when we try to use the BAPI we donot have any sales document created in the first instance(i.e. while creating an order) so the BAPI returns error and when i tried to populate the itabs in the program directly the new values just wont get processed.
I think like: in case its a new document and we face this scenario I can just terminate the document creation and create a new document using the BAPI with proper plant assignments.But i am doubtful about the stability of this process.
Kindly comment.
Thanks
Varun
Maybe you are looking for
-
Installing ADOBE AIR Runtime ?
Is it possible to install ADOBE AIR Runtime in silent mode without admin privileges on Windows? Regards
-
Report Engine crashing on Solaris when report with graph is given.
Hi, We are using following environment: Solaris 8 Oracle 9i Report Sevices. When we try to execute reports having graphs then the report engine crashes with the following exception: REP-0177: Error while running in remote server REP-56048: Engine rwE
-
How do I close the current web page in Safari?
UPgraded to IOS 8 because a friend said it cured his problems, so I took the plunge. BIg mistake. THis question concerns Safari. how do I close the current web page?
-
I am running Mac OSX 10.6.8 and iTunes 10.4.1, and when I click on an album or artist name to edit it, for example, if I place my cursor to the right of the last letter or select the last word and hit my delete key, all it does is highlight the chara
-
HELP!! trying to restore
I purchased an update from the itunes store and this did not work so had to restore, my ipod has been stuck in the restore mode for over 10 hours now and am at a loss as to what to do, help please