BAPI for purchase order .. to create and delete confirmation
HI Gurus
I need to create and delete PO(Purchase order) confirmation in SAP 4.7 R3 .
Please let me know which BAPI i can use for .. in SAP 4.7
1. Create PO confirmation
2. Delete PO confirmation
Many thanks and regards
Sandeep Sharma
Hi Sandeep,
In SAP 4.7 R3 & ECC 5.0. we don't have BAPI to delete / create PO confirmatons.
Use this FM for both : ME_CONFIRMATION_UPDATE
In addition to above , we need to use this FM : ME_CONFIRMATION_REDISTR_ITEMS , for PO item update in MD04 transaction.
In addtion to above 2 FM, you need to used Change doucment FM for write log data.
Thanks.
Similar Messages
-
BAPI for Purchase Order Confirmation and update EKES table
Hi all,
I have a requirement to update the PO confirmation soon after successful creation of PO in an IDOC.
I have used BAPI_PO_CHANGE function module which didnt serve the purpose as it cannot update confirmations.
I tried using ME_CONFIRMATION_UPDATE where I was able to add a confirmation entry in EKES table but that is not being reflected in ME23N transaction when I display the PO.
Please help me out on this.
Thanks & Regards
PavanNB: Never use a standard update FM (check attributes of ME_CONFIRMATION_UPDATE) its often only a SQL statement collector without any check, logging of changes or database consistency, if you perform a where-used you should find it is never called alone but with a bunch of other update FM after checks and other update preparation.
Get back to the BAPI and table parameter POCONFIRMATION, also use BAPI_PO_GETDETAIL1 to get current data for the call of BAPI_PO_CHANGE.
Regards,
Raymond
PS: If it is not in 197958 - BAPIs for purchase orders: Missing functions, you should be able to do it -
Class for Purchase order item components and Production order components
I'm looking for a some classes. I'm very new to objects, so I could be searching for them incorrectly.
The first class I'm looking for is a purchase order class that contains the item components. I've looked at CL_PO_ITEM_HANDLE_MM and CL_PO_HEADER_HANDLE_MM. I couldn't find components as a part of either of the classes.
The second one I'm looking for is not as critical. It is for the components for a production order. I have a function module: BAPI_PRODORD_GET_DETAIL that gets the components for the order. However, to take advantage of objects - I read somewhere - that if possible I should avoid calling a function module.
Any help that you could give would be greatly appreciated.
Thank you!
MichelleHello Michelle
I do not think there are already classes available on ERP 6.0 for reading production order (yet I might be wrong...). However, regarding purchase order you are already on the right track.
*& Report ZUS_SDN_OO_READ_PO
*& Thread: Class for Purchase order item components and Production order components
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1206523"></a>
"& NOTE: Coding adapted from BAPI_PO_GETDETAIL1
REPORT zus_sdn_oo_read_po.
TYPE-POOLS: abap, mmpur.
PARAMETER:
p_ebeln TYPE ebeln DEFAULT '3000000045'.
DATA: gs_document TYPE mepo_document,
go_po TYPE REF TO cl_po_header_handle_mm,
gs_header TYPE mepoheader,
gd_tcode TYPE sy-tcode,
gd_result TYPE mmpur_bool.
data: gt_items type PURCHASE_ORDER_ITEMS,
gs_itm type PURCHASE_ORDER_ITEM,
gs_item type mepoitem.
START-OF-SELECTION.
* prepare creation of PO instance
gs_document-doc_type = 'F'.
gs_document-process = mmpur_po_process.
gs_document-trtyp = 'A'. " anz. => display
gs_document-doc_key(10) = p_ebeln.
* object creation and initialization
** l_ebeln = purchaseorder.
CREATE OBJECT go_po.
CALL METHOD go_po->po_initialize( im_document = gs_document ).
CALL METHOD go_po->set_po_number( im_po_number = p_ebeln ).
CALL METHOD go_po->set_state( cl_po_header_handle_mm=>c_available ).
* read purchase order from database
gd_tcode = 'ME23N'.
CALL METHOD go_po->po_read
EXPORTING
im_tcode = gd_tcode
im_trtyp = gs_document-trtyp
im_aktyp = gs_document-trtyp
im_po_number = p_ebeln
im_document = gs_document
IMPORTING
ex_result = gd_result.
* there was a problem in reading the PO
IF ( gd_result EQ mmpur_no ).
** l_messages = l_handler->get_list_for_bapi( ).
** PERFORM return TABLES l_messages return
** poitem poschedule poaccount.
** CALL METHOD l_po->po_close( ).
ELSE.
gs_header = go_po->if_purchase_order_mm~get_data( ).
WRITE: / gs_header-ebeln,
gs_header-bukrs,
gs_header-bsart,
gs_header-lifnr.
ENDIF.
gt_items = go_po->if_purchase_order_mm~get_items( ).
LOOP AT gt_items INTO gs_itm.
gs_item = gs_itm-item->get_data( ).
write: / gs_item-ebelp,
gs_item-matnr,
gs_item-menge.
ENDLOOP.
END-OF-SELECTION.
Regards
Uwe -
IDOC Types for Purchase Orders, Vendor Master and Goods Receipt
Hello All,
Can any have idea about the IDOC Types that can be used for triggering when the actions creation/change/deletion on Purchase Orders or Vendor Master or Goods Receipt is performed?
Please let me know the names of IDOC Type, Process Codes, message type... and all the other required information...
Thanks in Advance,
Kumar.Hello Ferry,
Thanks again for the IDOC Types. I have another question. Can we use those IDOC types for creating/changing/deletion of Purchase orders or Vendor Master or Goods Receipt happens? I mean can we configure in such a way that when ever there is a change or deletion of PO or VM or GR happens?
I have got to know about the IDOC PORDCH01 which can be used for Purchase Order. Can u suggest me which can be used for PO's?
Regards,
Phani.
Message was edited by:
Sivapuram Phani Kumar -
Table For Purchase Order Version Number and Version Created Date
Dear Sir,
Whenever we make any change in Purchase Order , then a new Version Number along with Created Date is assigned . In Me23n the Version Number and It's Created date is also displayed ( at PO Header Level) .
We request you to kindly guide us as which Table is required to be reffered to get the Version Number and Version Created date for the Purchase Order .
With Thanks and Rgds
SoniaHi
Check in EKKO - Purchase order header
EKPO - Purchase order item
CDHDR
CHPOS
Regards
Ram
Edited by: Parasuram M on Sep 16, 2009 11:59 AM -
BAPI for Purchase Order Creation
Hi All,
Purchase Order creation through BAPI, Auto Po creation. Please advise program.
The requirement is: when we delivery the goods from one plant to another plant,PO should create in second plant with goods what delivered from first plant.
Pranitha
Moderator message : Spec/requirements dumping is not allowed. Thread locked.
Edited by: Vinod Kumar on Sep 30, 2011 3:37 PMHi,
As per u r requirement
you can use : BAPI => BAPI_PO_CREATE with suitable Document Type ( Stock trasnfert : STO )
IF u want to auto po must be created after each delivry in this case you need to use BADI
'MB_MIGO_BADI; In This BAPI There is method : POST_DOCUMENT
In this method u can write code for Auto PO Creation by using BAPI .
Hope This will Resolve u r query.
Thanks and Regads
Santosh -
BAPI for purchase order TA Me27
Hi,
I´m looking for a BAPI to create purchase orders like in TA ME27. I don´t have the vendor...
So I think, BAPI_PO_CREATE is not working because the vendor is mandatory...
Thank You!Sorry, I mean creating a stock transport order and therefore using TA ME27.
If you use order type 'UB' in TA ME27, you can create also stock transport orders...
Do you know a BAPI for that?
Thank You! -
FM or BAPI for Purchase Order Creation.
can ne1 help me to
create purchase order reference to PReq(Requisition) thru ne FM or BAPI.Hi,
We can create the PO Using the BAPI_PO_CREATE1 function module.
in this function module fill up the all necessary Details.
With details in Item Table we haveto give the Fields PREQ_NO and PREQ_ITEM for each item .
then it will creates the PO with PREQ.
Reward Points If useful.
Thanks&Regards,
Srinivas. -
BAPI for PURCHASE ORDER with OPEN QUANTITY field
Hi All,
I wanted to use the BAPI_PO_GETDETAIL to get the Purchase Order details upon triggering from Warehouse management system,
But the details required contains a field called OPEN QUANTITY...which is not used in this BAPI.
I request to let me know if any BAPI exits for PO details having the structure for this field:Open Quantity.
Am using SAP version 4.0B.
If not exists please advise how to customize the existing BAPI to meet the requirement.
thanks
mahiHi,
Open quantity is a calculated field. I guess the BAPI gives the details of the delivery, so take the ordered qty and substract the delivered qty from that.
Delivery data is EKET table.
Regards,
Ravi -
BAPI for Purchase order change
Hi experts,
I just want to change PO quantity by BAPI function module: BAPI_PO_CHANGE, I fill in PO number, Item number, material number and PO quantity to parameters, but result is not well. it shows a message below and the purchase order is not changed.
message:
For the currency code ALE communication is not allowed
Message no. B1889
Diagnosis
The ISO code assigned to the current currency code is not unique and the primary flag is NOT set. This currency code can therefore not be used for external communication.
I checked currency config in SPRO and the assignment of ISO code is unique and the primary flag is setted actually.
so what else can I do to solve this problem.
thanks in advance.
jackThe B1889 message has the following reasons:
-> The primary flag of the found ISO code is assigned more than once.
-> The ISO code is not unique and the primary flag is not assigned
for associated SAP currency codes.
-> The ISO code is not unique and the current SAP currency code has
NOT assigned the primary flag.
First case: CC ISOCD XPRIMARY
CNY CNY X
RMB CNY
Your ISO code is not unique, therefore you are using the primary flag.
If a dataset wich currency code CNY is encountered, everything is ok
because none of the 3 rules mentioned above can be applied.
If a dataset contains currence code RMB, rule (3) will be applied.
Therefore, you get the following output in this case:
"For curreny code RMB ALE Communication is not allowed"
Second case: CC ISOCD XPRIMARY
CNY CNY
RMB CNY X
If a dataset contains currency code RMB, everything is ok because it is
flagged as primary. Like in the first case, if CNY is encountered,
rule (3) will be applied and you will get the output:
"For curreny code CNY ALE Communication is not allowed"
If you are using both CNY and RMB together, it is not possible to avoi
the B1889 message beause there will be always the case that your ISO
code is not unique AND that one currency code is not flagged as primary,
which is summed up in rule (3).
Please see information in attached note "144349 ALE: Problems with
currency conve". -
BAPI for purchase order enhancement in DMS
hi, guru,
one of the client requirement is,
Is there any BAPI s for enhance ment of DMS and Purchase order FUnctionalities?
points!!!!!!!!!!1Hi,
regarding the DMS BAPIs please see the transaction BAPI in your system or the SAP note 766277 which contains a complete documentation on all DMS BAPIs.
Best regards,
Christoph -
Step by step bapi for purchase order
hi friends,
i am very new to bapi i have requiremet to upload purchase order
using bapi can any one tell me how to use bapi_po_create
which parameter i hvae to pass .plz do the need ful.
regards
sonuHi Sir,
I am sending you the code in which i have implemented bapi pocreate.Please go through the FM ,you will easily understand it.
Plz do reward if useful.
Thankx.
method do_handle_event.
*CALL METHOD SUPER->DO_HANDLE_EVENT
EXPORTING
EVENT =
HTMLB_EVENT =
HTMLB_EVENT_EX =
GLOBAL_MESSAGES =
RECEIVING
GLOBAL_EVENT =
data: event_id type string.
data zpr_num1 type banfn.
data zreturn type zsn_bapiret2.
data ret type bapireturn-type.
data message type bapi_msg.
data returnval type bapimepoheader-po_number.
data: r_view type ref to if_bsp_page.
data: crt_view type ref to if_bsp_page.
data po_num_head type bapimepoheader.
data zpoheader_it type zbapimepoheader_tab.
data zpoheaderx_it type zbapimepoheaderx_tab.
to add a new item to list
if htmlb_event is bound and htmlb_event->server_event = 'onadd'.
zpr_num = request->get_form_field( 'PRNo' ) .
data: zpr_num3 type banfn.
call function 'ZCONVERT_ALPHA'
exporting
input = zpr_num
importing
output = zpr_num3.
zpr_num = zpr_num3.
data: temp_tab1 type zrmheader.
delete from zrmheader.
zpoheader-vendor = request->get_form_field( 'Vendor' ) .
zpoheader-purch_org = request->get_form_field( 'POrg' ).
zpoheader-pur_group = request->get_form_field( 'PGrp' ).
zpoheader-doc_type = 'NB'.
zpoheader-item_intvl = request->get_form_field( 'Item' ).
zpoheader-comp_code = request->get_form_field( 'CCode' ).
zpoheader-doc_date = request->get_form_field( 'DocDate' ).
delivdate_new = request->get_form_field( 'DelivDate' ).
temp_tab1-vendor = request->get_form_field( 'Vendor' ) .
temp_tab1-purch_org = request->get_form_field( 'POrg' ).
temp_tab1-pur_group = request->get_form_field( 'PGrp' ).
temp_tab1-doc_type = 'NB'.
temp_tab1-item_intvl = request->get_form_field( 'Item' ).
temp_tab1-comp_code = request->get_form_field( 'CCode' ).
temp_tab1-doc_date = request->get_form_field( 'DocDate' ).
data: temp_tabx1 type zrmheaderx.
delete from zrmheaderx.
temp_tabx1-vendor = 'x'.
temp_tabx1-purch_org = 'x'.
temp_tabx1-pur_group = 'x'.
temp_tabx1-doc_type = 'x'.
temp_tabx1-comp_code = 'x'.
temp_tabx1-doc_date = 'x'.
insert into zrmheader values temp_tab1.
insert into zrmheaderx values temp_tabx1.
data: temp_tab type zrmitem .
data: temp_tabx type zrmitemx.
zitem1-acctasscat = request->get_form_field( 'A' ).
temp_tab-acctasscat = request->get_form_field( 'A' ).
zitem1-item_cat = request->get_form_field( 'I' ).
temp_tab-item_cat = request->get_form_field( 'I' ).
zitem1-material = request->get_form_field( 'Material' ).
temp_tab-material = request->get_form_field( 'Material' ).
zitem1-quantity = request->get_form_field( 'POQuantity' ).
temp_tab-quantity = request->get_form_field( 'POQuantity' ).
zitem1-po_unit = request->get_form_field( 'OUN' ).
temp_tab-po_unit = request->get_form_field( 'OUN' ).
zitem1-net_price = request->get_form_field( 'NetPrice' ).
temp_tab-net_price = request->get_form_field( 'NetPrice' ).
zitem1-plant = request->get_form_field( 'Plnt' ).
temp_tab-plant = request->get_form_field( 'Plnt' ).
zitem1-po_item = request->get_form_field( 'Item' ).
temp_tab-po_item = request->get_form_field( 'Item' ).
zitem1-stge_loc = request->get_form_field( 'Sloc' ).
temp_tab-stge_loc = request->get_form_field( 'Sloc' ).
zitem1-customer = request->get_form_field( 'Customer' ).
temp_tab-customer = request->get_form_field( 'Customer' ).
zitem1-incoterms2 = 'XDFGRT'.
temp_tab-incoterms2 = 'XDFGRT'.
append zitem1 to zitem.
insert into zrmitem values temp_tab.
zitemx1-acctasscat = 'x'.
zitemx1-item_cat = 'x'.
zitemx1-material = 'x'.
zitemx1-quantity = 'x'.
zitemx1-net_price = 'x'.
zitemx1-plant = 'x'.
zitemx1-po_item = 00010.
zitemx1-po_itemx = 'x'.
zitemx1-stge_loc = 'x'.
zitemx1-customer = 'x'.
zitemx1-incoterms2 = 'x'.
append zitemx1 to zitemx.
temp_tabx-acctasscat = 'x'.
temp_tabx-item_cat = 'x'.
temp_tabx-material = 'x'.
temp_tabx-quantity = 'x'.
temp_tabx-net_price = 'x'.
temp_tabx-plant = 'x'.
temp_tabx-po_item = 00010.
temp_tabx-po_itemx = 'x'.
temp_tabx-stge_loc = 'x'.
temp_tabx-customer = 'x'.
temp_tabx-incoterms2 = 'x'.
insert into zrmitemx values temp_tabx.
select * from zrmitem into corresponding fields of table zitem.
zpr_num = request->get_form_field( 'PRNo' ) .
call function 'ZCONVERT_ALPHA'
exporting
input = zpr_num
importing
output = zpr_num1.
LEN =
call function 'BAPI_REQUISITION_GETDETAIL'
exporting
number = zpr_num1
ACCOUNT_ASSIGNMENT = ' '
ITEM_TEXTS = ' '
SERVICES = ' '
SERVICE_TEXTS = ' '
tables
requisition_items = item_tab
REQUISITION_ACCOUNT_ASSIGNMENT =
REQUISITION_TEXT =
REQUISITION_LIMITS =
REQUISITION_CONTRACT_LIMITS =
REQUISITION_SERVICES =
REQUISITION_SERVICES_TEXTS =
REQUISITION_SRV_ACCASS_VALUES =
RETURN =
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
*IMPORTING
*RETURN = i_return
to save the item details and generate a PO number
elseif htmlb_event is bound and htmlb_event->server_event = 'onsave'.
zpr_num = request->get_form_field( 'PRNo' ) .
data: zpr_num4 type banfn.
call function 'ZCONVERT_ALPHA'
exporting
input = zpr_num
importing
output = zpr_num4.
zpr_num = zpr_num4.
data: temp_t2 type zrmsched,
count2 type n,
a2 type n value 1.
data:temp_t type zrmitem,
count type n,
a type n value 1.
select * from zrmitem into corresponding fields of table data_tab.
count = sy-dbcnt.
do count times.
read table data_tab into temp_t index a.
a = a + 1.
zitem1-po_item = temp_t-po_item.
zitem1-acctasscat = temp_t-acctasscat.
zitem1-item_cat = temp_t-item_cat.
zitem1-material = temp_t-material.
zitem1-quantity = temp_t-quantity.
zitem1-po_unit = temp_t-po_unit.
zitem1-net_price = temp_t-net_price.
zitem1-plant = temp_t-plant.
zitem1-stge_loc = temp_t-stge_loc.
zitem1-customer = temp_t-customer.
zitem1-incoterms2 = temp_t-incoterms2.
append zitem1 to zitem.
zitemx1-acctasscat = 'x'.
zitemx1-item_cat = 'x'.
zitemx1-material = 'x'.
zitemx1-quantity = 'x'.
zitemx1-net_price = 'x'.
zitemx1-plant = 'x'.
zitemx1-po_item = temp_t-po_item.
zitemx1-po_itemx = 'x'.
zitemx1-stge_loc = 'x'.
zitemx1-customer = 'x'.
zitemx1-incoterms2 = 'x'.
append zitemx1 to zitemx.
enddo.
count2 = sy-dbcnt.
zpoheader-vendor = request->get_form_field( 'Vendor' ) .
zpoheader-purch_org = request->get_form_field( 'POrg' ).
zpoheader-pur_group = request->get_form_field( 'PGrp' ).
zpoheader-doc_type = 'NB'.
zpoheader-item_intvl = request->get_form_field( 'Item' ).
zpoheader-comp_code = request->get_form_field( 'CCode' ).
zpoheader-doc_date = request->get_form_field( 'DocDate' ).
delivdate_new = request->get_form_field( 'DelivDate' ).
zpoheaderx-vendor = 'x'.
zpoheaderx-purch_org = 'x'.
zpoheaderx-pur_group = 'x'.
zpoheaderx-doc_type = 'x'.
zpoheaderx-comp_code = 'x'.
zpoheaderx-doc_date = 'x'.
data: zpovendor type elifn.
call function 'ZCONVERT_ALPHA'
exporting
input = zpoheader-vendor
importing
output = zpovendor.
zpoheader-vendor = zpovendor.
call function 'BAPI_PO_CREATE1'
exporting
poheader = zpoheader
poheaderx = zpoheaderx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
importing
exppurchaseorder = po_num
EXPHEADER = PO_NUM_HEAD
EXPPOEXPIMPHEADER =
tables
RETURN = zreturn
poitem = zitem
poitemx = zitemx
POADDRDELIVERY =
POSCHEDULE = zposched
POSCHEDULEX = zposchedx
POACCOUNT =
POACCOUNTPROFITSEGMENT =
POACCOUNTX =
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
POCOMPONENTS =
POCOMPONENTSX =
POSHIPPING =
POSHIPPINGX =
POSHIPPINGEXP =
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
IMPORTING
RETURN =
delete from zrmitem.
delete from zrmitemx.
select * from zrmitem into corresponding fields of table zitem.
if po_num = ' '.
po_num = 'Try Again'.
endif.
to store po_num and corresponding pr number
data: temp_tt type zpo_pr_nums.
temp_tt-pr_num = zpr_num.
temp_tt-po_num = po_num.
insert into zpo_pr_nums values temp_tt.
to store po num and corresponding delivery date
data: wa11 type zpo_delivdate.
wa11-po_number = po_num.
wa11-deliv_date = delivdate_new.
insert into zpo_delivdate values wa11.
zpoheader-vendor = ' '.
zpoheader-purch_org = ' '.
zpoheader-pur_group = ' '.
zpoheader-doc_type = ' '.
zpoheader-item_intvl = ' '.
zpoheader-comp_code = ' '.
zpoheader-doc_date = ' '.
delivdate_new = ' '.
to enter a PR Number
elseif htmlb_event is bound and htmlb_event->server_event = 'onenter'.
delete from zrmitem.
delete from zrmitemx.
select * from zrmitem into corresponding fields of table zitem.
zpr_num = request->get_form_field( 'PRNo' ) .
call function 'ZCONVERT_ALPHA'
exporting
input = zpr_num
importing
output = zpr_num1.
LEN =
call function 'BAPI_REQUISITION_GETDETAIL'
exporting
number = zpr_num1
ACCOUNT_ASSIGNMENT = ' '
ITEM_TEXTS = ' '
SERVICES = ' '
SERVICE_TEXTS = ' '
tables
requisition_items = item_tab
REQUISITION_ACCOUNT_ASSIGNMENT =
REQUISITION_TEXT =
REQUISITION_LIMITS =
REQUISITION_CONTRACT_LIMITS =
REQUISITION_SERVICES =
REQUISITION_SERVICES_TEXTS =
REQUISITION_SRV_ACCASS_VALUES =
RETURN =
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
*IMPORTING
*RETURN = i_return
to select an item from drop down item menu
elseif htmlb_event is bound and htmlb_event->server_event = 'select'.
data: zselection2 type bnfpo.
data: data type ref to cl_htmlb_dropdownlistbox.
zpr_num = request->get_form_field( 'PRNo' ) .
data: zpr_num2 type banfn.
call function 'ZCONVERT_ALPHA'
exporting
input = zpr_num
importing
output = zpr_num2.
data ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'dropdownlistbox'
id = 'ItemSel'
if data is not initial.
zselection2 = data->selection.
endif.
zpoheader-vendor = request->get_form_field( 'Vendor' ) .
zpoheader-purch_org = request->get_form_field( 'POrg' ).
zpoheader-pur_group = request->get_form_field( 'PGrp' ).
zpoheader-doc_type = 'NB'.
zpoheader-item_intvl = request->get_form_field( 'Item' ).
zpoheader-comp_code = request->get_form_field( 'CCode' ).
zpoheader-doc_date = request->get_form_field( 'DocDate' ).
call function 'BAPI_REQUISITION_GETDETAIL'
exporting
number = zpr_num2
ACCOUNT_ASSIGNMENT = ' '
ITEM_TEXTS = ' '
SERVICES = ' '
SERVICE_TEXTS = ' '
tables
requisition_items = item_tab
REQUISITION_ACCOUNT_ASSIGNMENT =
REQUISITION_TEXT =
REQUISITION_LIMITS =
REQUISITION_CONTRACT_LIMITS =
REQUISITION_SERVICES =
REQUISITION_SERVICES_TEXTS =
REQUISITION_SRV_ACCASS_VALUES =
RETURN =
data wa1 type bapieban.
loop at item_tab into wa1.
if wa1-preq_item = zselection2.
item_new = wa1-preq_item.
material_new = wa1-material.
plant_new = wa1-plant.
quantity_new = wa1-quantity.
unit_new = wa1-unit.
delivdate_new = wa1-deliv_date.
endif.
endloop.
endif. -
Hi all,
I have to retrieve the invoice verification due date given the following:
Retrieve batch number from item level of billing (VBRP-CHARG)
Pick up purchase order number from batch master data MCH1
Based on PO number, retrieve invoice verification number (EKBE-BELNR) where :
1. EKBE-EBELN = PO Number
2. EKBE-VGABE = 2
Based on Invoice receipt number, pick up due data on BSEG-FDTAG where BSEG-BLNR is equal with above invoice verification number.
I've done the first bullet point but don't know how to proceed. How can i pick up the purchase order number, do we have any BAPI for that?
Thanks!Used FM VB_BATCH_GET_DETAIL to get PO number
-
BAPI for Purchase Order Vendor Confirmations
Can any body suggest me the BAPI for the purchase order vendor confirmations transaction code me22n - Tab<b>-(Confirmations)</b> alone.
regs,
RajaDear Asha,
Pls find the below code, this handles only the BDC part of the program.Updates only the EKES table thru standard confirmation tab on ME22N.
Kindly clarify any doubts in this reg.
regs,
Raja.
FORM ins_stdtable .
DATA:var TYPE c LENGTH 30,
cstr(02) TYPE n value '01'.
data istr(02) type n value '00'.
DATA recno TYPE i.
data: eblc type c length 5,
ebli type i.
DATA: kebeln LIKE utab-ebeln.
DATA: BEGIN OF indx,
ebelp type ekes-ebelp,
eindx type i,
END OF indx.
DATA : CNT TYPE I value 1.
DATA: COUNTER(2) TYPE N VALUE '01',
ROWS TYPE P.
DATA: w_textout LIKE t100-text.
DATA: gd_update TYPE i,
gd_lines TYPE i.
data :waek like indx,
itabek LIKE TABLE OF waek.
*Used to stores error information from CALL TRANSACTION Function Module
DATA: BEGIN OF messtab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
SELECT MAX( ETENS ) FROM ekes INTO zetens WHERE ebeln =
ekko-ebeln.
recno = zetens.
LOOP AT utab.
SELECT distinct ebelp INTO CORRESPONDING FIELDS OF TABLE
itabek FROM eket WHERE ebeln = ekko-ebeln.
loop at itabek into waek.
ebli = ebli + 1.
waek-eindx = ebli.
modify itabek from waek.
endloop.
loop at itabek into waek where ebelp = utab-ebelp.
eblc = waek-eindx.
condense eblc.
endloop.
AT NEW ebeln.
PERFORM bdc_dynpro USING 'SAPLMEGUI' '0014'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MECHOB'.
PERFORM bdc_dynpro USING 'SAPLMEGUI' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MEOK'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MEPO_SELECT-EBELN'.
PERFORM bdc_field USING 'MEPO_SELECT-EBELN'
utab-ebeln.
AT New EBELP.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_CURSOR'
'DYN_6000-LIST'.
perform bdc_field using 'DYN_6000-LIST'
eblc.
perform bdc_field using 'BDC_OKCODE'
'=DDOWN3200'.
PERFORM bdc_dynpro USING 'SAPLMEGUI' '0014'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TABIDT15'.
perform bdc_field using 'DYN_6000-LIST'
eblc.
PERFORM bdc_dynpro USING 'SAPLMEGUI' '0014'.
PERFORM bdc_field USING 'BDC_OKCODE'
'PICK'.
ENDAT.
ENDAT.
PERFORM bdc_field USING 'DYN_6000-LIST'
eblc.
recno = recno + 1.
cstr = recno.
counter = cstr.
*This is to check whether the scheduled line item exceeding 12 rows. if so, use *page up
if counter >= 13.
rows = counter MOD 13.
istr = ( ( counter - rows ) / 13 ).
do istr times.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=EINB_CREATE'.
enddo.
DO 2 TIMES.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
enddo.
COUNTER = '03'.
cstr = '03'.
ENDIF.
CONCATENATE 'EKES-EBTYP(' cstr ')' INTO var.
PERFORM bdc_field USING 'BDC_CURSOR'
var.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING var
utab-ebtyp.
CONCATENATE 'RM06E-EEIND(' cstr ')' INTO var.
PERFORM bdc_field USING var
utab-eeind.
CONCATENATE 'EKES-MENGE(' cstr ')' INTO var.
PERFORM bdc_field USING var
utab-menge.
CONCATENATE 'J_3ASZDI-J_3ASIZED(' cstr ')' INTO var.
PERFORM bdc_field USING var
utab-j_3asize.
AT END OF Ebelp.
PERFORM bdc_dynpro USING 'SAPLMEGUI' '0014'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MESAVE'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
CALL TRANSACTION 'ME22N' USING bdcdata MODE 'E'.
IF sy-subrc EQ 0.
savedone = 'Y'.
saveflag = 'Y'.
initflag = 'N'.
MESSAGE 'SAVED' TYPE 'I'.
else.
saveflag = 'N'.
savedone = 'N'.
initflag = 'Y'.
MESSAGE 'Not Saved' Type 'I'.
endif.
CLEAR: bdcdata.
REFRESH bdcdata.
ENDAT.
ENDLOOP.
ENDFORM.
Hope this will help u -
Hello...
which Bapi should I use for enter to a material Purchase Order Text(MM01 or MM02)??
Thanks ......Hi,
i am not shure about the bapi
but this FM solves u r problem.
K_PURCHASE_ORDERS_READ_TEXTS
Thanks
Maybe you are looking for
-
Satellite P200D-12f PSPBQE - Question about CPU/GFX temperature
Hey guys, Here are the laptop specs: TOSHIBA Satellite Series P200D-12F Notebook - AMD Turion 64 X2 Processor TL-62 2.1GHz 2MB Cache, 2048MB DDR2-667 SO-Dimm Memory (2x1024), DVD Super Multi writer optical drive, 250 GB SATA, 5400 obr/min, 17.1" WXGA
-
Hi Friends, Need Help. We are attaching Attachment lists to Business Objects using SAP Archivelink Early Storage method. When I goto Sales Order having multiple attachments - highlight multiple attachments and double click View Attachment - I view
-
How re-install Quicktime Pro with my key on new hard drive?
-
Hi - is it possible to sum up two accounts across 3 years? this is the concept.. new_value = account1 + account2 + Fy09 + fy10 + fy11 thanks
-
How to add a quicktime file to a shake script?
Hi I just purchased Shake 4.1 and can't figure out for the life of me how to add another quicktime file as a node in a script I am working on. Example: The source node file I sent from FCP which I need to key and add the background image to. How do I