I need output type NEU automaticaly for create purchase order document type
Dear Experts,
I need output type NEU automaticaly for create purchase order document type NB
when transaction code MN04, I am doing the following:
(1) I selected the third option Purchasing Output determination: Document type
(2) I selected the output type NEU.
(3) In condition records in document type , i have chosen NB.
(4) In name its automatically coming as Purchase requisition
Please suggest how Purchase Order NB will come
Hi,
Check & press F4, NB Purchase Order (for catagory F) will be there after entering PO output type NEU & then maintaion the condition record in MN04.
Output type NEU automaticaly defaulted during purchase order creation with document type ,then just fine tune the output (message) type in following path:
SPRO--->MM->Purchasing>Message>Output control->Message types> Define message type for Purchase Order----->Fine-Tuned Control: Purchase Order
Now here select the check box corresponding to your output(message) type NEU to have print output automatically displayed & save.
Now try to creating Purchase Order & you will have default message type NEU.
Regards,
Biju K
Similar Messages
-
Message output for New Purchase Order Document type
Hi experts,
I am having trouble getting a Print message output for a New Purchasing Document type that I created.
Steps that I followed are:
1.Created a new Document type NS via customizing.
2.Assigned the new Purchasing Document Type NS to Output Type NEU which is linked to our customized form for Purchase order display. I used MN04 /NACE to do this step.
Now the message output gets created for my new document type NS but I am unable to display the message.
Notes:
-There are no release stratergies in place for document type NS
-The NEU format works fine the other document type NB which we use for Standard POs.
Are there any steps I have missed? Please help to resolve the issue.
Arosh.Goto NACE select application EF Purchase Order then goto condition record NEU select condition record select the last key combination "Purchasing Output Determination: Document Type"
here enter your doc. type execute
maintain the condition record
NS VN(function) 1 3 EN and click on communication and maintain
Or goto NACR here put EF and NEU and select the last combination "Purchasing Output Determination: Document Type"
maintain ..
NS VN(function) 1 3 EN and click on communication and maintain
Hope it helps.. -
Search user-exit for create purchase order
Hi all,
i'm searching the user-exit (or BADI) for create purchase order.
Thanks for help.Hi CECG,
GOTO SMOD and press F4
then Click on Information system
and in the Package name give as ME
and press enter.
you will get all user exits for Purchase Orders
Hope this solves your problem.
Please reward points if found helpful.
Thanks and regards,
Rajeshwar. -
Authorization based on plant and Purchase order document type
Hi
My client has a requirement wherein a user will have authorization for transactions only in his plant. But only for Purchase order document type UB (Stock Transport Order) the user should be allowed to create for all plants.
In short, if Purchase order document type is UB, should be allowed for all plants
if Purchase order document type is NB, should be allowed to only one particular plant.
My Basis person says that such a restriction is not possible.
Kindly suggest me on how to provide a solution to this.
Thank U.Hi,
This is possible.In this case you need to create two seperate roles.
1)Create purchase order for all plants (This can be used in long text)
2)Create purchase order for <plant no> plants.
For case 1:--
i)Populate field BSART of M_BEST_BSA with UB.
ii)Populate field WERKS of M_BEST_WRK with '*'. SAP reccomends to fill up organizational data through organizational level tab only.So while doing this step you need to put * from organizational level tab only.
For case 2:--
i)Populate field BSART of M_BEST_BSA with NB.
ii)Populate field WERKS of M_BEST_WRK with 'plant no'.
Dont worry about the objects i mentioned those are maintained through SU24 and will be automatically pulled once you insert ME21 transaction code.
Let me know if it helps.
Thanks,
Aveek -
Material Statuses based on the Purchase order Document type
Hi Experts,
We need to maintain the Plant material status based on the purchase order document type.
Example - If I am using NB for normal purchase orders and ZB for STO procurement then, there should be a material status which should give warning message - 'do not use ' for ZB STO purchase orders and it should allow to create NB purchase orders for that same materials.
Please advise what are the possibilities?
Thanks
Regards
MMHi Gurus,
Thank you for your reply, Please find my replies below
@@ - Mallinath - We need this restrictions for some type of materials ( with specific Material types) which should not be procured through inter company STO process, buying plant should use the normal purchase. for other Material types they should be able to use the inter company STO process.
@@ DEV - We are already using the Spl. Procurement keys for inter company STO process.
Example - Material type ZXYX should not use the inter company STO process, but it should be allowed all other processes.
Please advise how we can control this process?
Thanks
Regards
Raja -
Purchase Order Document Type and Account Assignment
Hi ,
We have a requirement to control Account Assignment in Purchase Order Item line based on the Document type selected on the Purchase Order header.
Like if user selects Purchase Order document type "ZNB" (Customized created) , then he will only able to select "K" or Blank or "P" as account assignment and similary we want to limit other Account assignments based on the Purchase Document type.
How can we make this Control settings?
Regards
ShreyHi,
You can't really limit the account assignment categories per document type, at least not directly.
You can limit the item categories that can be used for a document type via configuration:
Materials Management > Purchasing > Purchase Order > Define Document Types
Within this transaction you can define which item categories are valid for a specific document type.
You can then define which account assignment categories are valid for each item category
Materials Management > Purchasing > Account Assignment > Define Combination of Item Categories/Account Assignment Categories
BUT
limiting the account assignment categories that are valid for an item category will affect ALL purchase order document types that this item category is valid for. And you can't create your own item categories as this is a SAP standard table that can NOT be altered.
Regards,
Monika -
Purchase Order Document type FO?
Hi,
Why we need to use in Purchase Order Document type FO?
With Document type NB also we can make Services ,Right?
ThanksHi
FO - Frame work order Document type is a standard document type , which is used for Blanket Purchases, Purchase of services.
The FO document type has a Validity Start & End date feature whcih is not in the NB document type(You can get the same in NB also after cusotmization)
Services & limits are also presnet. The FO document type is limited to usage for Iterm categories
Standard
B Limit
D Service
All these can be made for NB also, but only after customizing.
Thanks & Regards
Kishore -
Purchase Order Document Type Defaulting in ME58 while converitn PR to PO
Dear All
While converting Purcahse Requesition to Purchase Order in ME58, System defaults one Purchase order document type . Ofcourse we can overwrite that
But would like to know how this defaulting can be controlled in SAP
Regards
ShyamHi,
If you have maintained an "Order Type" in table T160 (customizing
transaction OMH5) for the entry "ME21", then this value will be
defaulted in the pop-up in transaction ME58. Otherwise, the "Order Type"
of the Requisition will be defaulted.
The following code block of program (Note 125969) is for your reference:
SELECT SINGLE * FROM T160 WHERE TCODE EQ SY-TCODE.
IF SY-SUBRC EQ 0 AND NOT T160-BSART IS INITIAL.
RM06E-BSART = T160-BSART.
ELSE.
SELECT SINGLE * FROM T160 WHERE TCODE EQ 'ME21'.
IF SY-SUBRC EQ 0 AND NOT T160-BSART IS INITIAL.
RM06E-BSART = T160-BSART.
ELSE.
RM06E-BSART = BAT-BSART.
ENDIF.
ENDIF
According to the code above, the system first checks the table T160 for
ME58, if there is no data then for ME21, if there is no data, then it
defaults from PREQ.This is the same as described in the note 114213.
BR
Nadia Orlandi -
Restrict purchase order document type at plant level
Dear,
I would like to restrict the purchase order document type at plant level,
Plz help me.Hi Dear,
at the Plant level you have to use the below given Authorization Objects for the Users in different Plant
M_BEST_BSA Document Type in Purchase Order
M_BEST_WRK Plant in Purchase Order
Give the values of the respective Plant and Order Type for the Respective Users.
For more help you can contact your Security Team.
but before that please check out in the T-Code SU24, if both the Objects are active, if not then ask the ABAP person to activate them.
Hope it helps you.
regards,
yawar Khan -
How to prevent Output to be generated for Return Purchase Order.
Hi All,
while creating a return Purchase Order the output is getting triggered. Now for Return Purchase Order the business does not want the output to be generated.
So is there a way by which we can have the automatic output generated for normal Purcahse Order but not for Return Purchase Order.
The system uses standard Output Type NEU for message. And condition record maintained for generating output (print/email) while saving.
Is there a way by which this issue can be addressed. if so how ?
Thanks.Dear all ,
a material goes storage location to client through pr ,in client site i get faulty material
i want to retorn that to my plant or storage location
that basis how to make retorn po and what are the procedure ?
what is movement type ?
Regards
shiv -
SRM 7.0 Output for changed purchase order documents
Hi all,
if we change purchase orders we like to send a PO output document for changed purchase orders only if we change certain PO fields in header or items.
What is the functionality in PO - Header - Output - Order and Send Immediatelly ? We thought that this function is the solution!
But independent we press the button <Order and Send Immediatelly > or button <Order> the system creates allways an output document in any cases of PO field changes which will be sent to a supplier (fax, email). How we can control that a PO document only will be created in cases we define ?
Kind Regards
Edited by: Hermann-Josef Wessels on Mar 28, 2011 6:53 PMHi Jay,
we like to control the output because PO changes for G/L account, cost centre or change from account assigment order to cost centre are not interesting for the supplier and in this cases a PO document should not be sent to the supplier. This was the main reason why we like to use function <Order and Send Immediatelly>.
So I would like to clarify the requirement:
1. Automatic created output document if a new PO will be created
2. Automatic created output document if a PO will be changed but no output if the following fields will be changed:
e.g. for G/L account, cost centre or change from account assigment order to cost centre
So we come back in our discussion to table: BBPV_COMP_FIELDS. There are entries for POO = PO Output and POR = Version comparison for Purchase Order.
Question: Can I use structure name: BBP_PDS_ACC for our requirement. If yes which field-names I have to maintain in detail in this table. If possible I need the entries in detail.
Kind Regards
Edited by: Hermann-Josef Wessels on Mar 30, 2011 9:20 AM -
Program for Creating Purchase Order with reference to purchase requisition
Hi ,
I need to Create purchase Order with reference to Purchase requisition,
in my case i need to automize the Process which is happening in MD04,
Can you please suggest me ?
Thanks ,
MuraliHi,
Plz check this link. It will be helpful to you.
Purchase order creation with reference to PR
We can also 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.
Thanks & Regards,
Sarita Singh Rathour
Edited by: Sarita Rathour on Aug 3, 2009 7:01 AM -
LOGIC FOR CREATING Purchase Order FOR repective Purchase Requisiton URGENT
hi all,
guys i have got all the purchase requisition for the materials from EBAN table.
now i have to create the PURCHASE ORDER for these PURCHASE REQUISITIONS.
so how should i proceed.
what logic i should use to create the PO for These PR.
if anyone of u have any code regd this requirement then plz share it with me.
its very urgent, i have to deliver it by today evening.
plz help me .
i will award ur efforts.
Thanks
Sanjeevhi,
Automatic Conversion of PR to PO
You created purchase requisition for various material. During creation of purchase order you used the following path:
Purchase Requisition
.......Follow on function
.........Create Purchase Order
............automatic via purReq.
When you mentioned required purchase requisition number and execute, system give error that purchase requisition does not contain any suitable item.
Is there any setting in customization where you can monitor and use that function.
In an effort for you to successfully use the Transaction Code ME59 to automatically convert the current PR into PO, then the following criteria should be met:
1) In the Purchasing View of the material master data, the "Autom. PO" field must be clicked;
2) In the Purchasing View of the Vendor Master Data, the "Automatic Purchase Order" field must be clicked;
3) The Outline Agreement or Purchasing Info Record shall be maintained which will allow the automatic copying of unit price and other conditions into PO;
4) The Source List shall be maintained for the nominated vendor which was shown in either the Outline Agreement or Purchasing Info Record.
or
it might be PR subject to release strategy and not yet released
or
If you're not using a source list or automatic creation of PO, you may need to assign the requisition to a purchase information record using transaction ME56. Then it should appear in ME58.
reward points to helpful answers.
rgds -
Purchase order document type wise park invoice creation authorization
Dear Experts,
at present our purchasing person is creating park invoice against all type of purchase order,we want to restrict him for certain purchase order type for creation of park invoice,is it possible what is procedure,please advice
Regards,
Shyam ShindeShyam,
As said by varma, if you looking for FB60/FV50?then u need to search before you post.
Thanks,
Sri -
Bapi for creating purchase order
hi, iam using BAPI_PO_CREATE1 to create PO's for service. after creating opne PO if i go and create another po within a short span of a minute or so then it does not create the second PO. it gives message that doc does not contain any items.
TABLES: ekpo,zcta_podates,ekko.
DATA iekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
DATA iekko LIKE ekko OCCURS 0 WITH HEADER LINE.
DATA ipodates LIKE zcta_podates OCCURS 0 WITH HEADER LINE.
DATA : wabldat1 LIKE zcta_podates-podat.
DATA : wabldat2 LIKE zcta_podates-podat.
DATA : wabldat3 LIKE zcta_podates-podat.
DATA : wabldat4 LIKE zcta_podates-podat.
DATA : wabldat5 LIKE zcta_podates-podat.
DATA : wabldat6 LIKE zcta_podates-podat.
DATA : wabldat7 LIKE zcta_podates-podat.
DATA :fname1 TYPE string.
DATA :w_fname1 TYPE string.
DATA : BEGIN OF itab1 OCCURS 0 ,
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(15),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
val3(10),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzlangu LIKE ekpo-zzlangu,
zzedition LIKE ekpo-zzedition,
zzcolorhue LIKE ekpo-zzcolorhue,
zztypeofad LIKE ekpo-zztypeofad,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab1.
DATA :BEGIN OF itab2 OCCURS 0, " radio
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzprogramname LIKE ekpo-zzprogramname,
zzdealstructure LIKE ekpo-zzdealstructure,
zztimeband LIKE ekpo-zztimeband,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab2.
DATA :BEGIN OF itab3 OCCURS 0, "tv
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzgenre LIKE ekpo-zzgenre,
zzprogramname LIKE ekpo-zzprogramname,
zzdealstructure LIKE ekpo-zzdealstructure,
zztimeband LIKE ekpo-zztimeband,
zzlangu LIKE ekpo-zzlangu,
zzcity(20), " LIKE ekpo-zzcity,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab3.
DATA :BEGIN OF itab4 OCCURS 0, "OUTDOOR
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
cond(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzlocationorroad LIKE ekpo-zzlocationorroad,
zztypeofad LIKE ekpo-zztypeofad,
zztrafficdirtn LIKE ekpo-zztrafficdirtn,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab4.
DATA :BEGIN OF itab5 OCCURS 0, "INTERNET
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
cond(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zztypeofad LIKE ekpo-zztypeofad,
zzsection LIKE ekpo-zzsection,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab5.
DATA :BEGIN OF itab6 OCCURS 0, "CINEMA
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
cond(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzcity LIKE ekpo-zzcity,
zzlocationorroad LIKE ekpo-zzlocationorroad,
zzcinemaname LIKE ekpo-zzcinemaname,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab6.
DATA :BEGIN OF itab7 OCCURS 0, "OTHER MEDIA
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(12),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
val3(10),
val4(10),
zzformat LIKE ekpo-zzformat,
zcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzedition LIKE ekpo-zzedition,
zzcolorhue LIKE ekpo-zzcolorhue,
zztypeofad LIKE ekpo-zztypeofad,
zzlangu LIKE ekpo-zzlangu,
zzgenre LIKE ekpo-zzgenre,
zzprogramname LIKE ekpo-zzprogramname,
zzdealstructure LIKE ekpo-zzdealstructure,
zztimeband LIKE ekpo-zztimeband,
zzlocationorroad LIKE ekpo-zzlocationorroad,
zzsection LIKE ekpo-zzsection,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab7.
DATA :BEGIN OF itab8 OCCURS 0, "NO MEDIA
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
qty(12),
gross(12),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzcity LIKE ekpo-zzcity,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF itab8.
DATA : BEGIN OF str OCCURS 0,
txz01 LIKE mepo1211-txz01,
werks LIKE mepo1211-name1,
srvpos LIKE esll-srvpos,
gross(15),
val1(10), "LIKE esll-frmval1,
val2(10), " LIKE esll-frmval2
val3(10),
val4(10),
zzformat LIKE ekpo-zzformat,
zzcampaign LIKE ekpo-zzcampaign,
zzmeansofad LIKE ekpo-zzmeansofad,
zzcity LIKE ekpo-zzcity,
zzlangu LIKE ekpo-zzlangu,
zzedition LIKE ekpo-zzedition,
zzcolorhue LIKE ekpo-zzcolorhue,
zztypeofad LIKE ekpo-zztypeofad,
zzillumination LIKE ekpo-zzillumination ,
zztrafficdirtn LIKE ekpo-zztrafficdirtn ,
zzstore LIKE ekpo-zzstore ,
zzcasting LIKE ekpo-zzcasting ,
zzgenre LIKE ekpo-zzgenre ,
zzsection LIKE ekpo-zzsection ,
zznumberofdays LIKE ekpo-zznumberofdays ,
zzprogramname LIKE ekpo-zzprogramname ,
zzdealstructure LIKE ekpo-zzdealstructure ,
zztimeband LIKE ekpo-zztimeband ,
zzdate LIKE ekpo-zzdate ,
zzdaysofwk LIKE ekpo-zzdaysofwk ,
zzasnum LIKE ekpo-zzasnum ,
zzlocationorroad LIKE ekpo-zzlocationorroad ,
zzcinemaname LIKE ekpo-zzcinemaname ,
zzcapacity LIKE ekpo-zzcapacity ,
zzfield2 LIKE ekpo-zzfield2 ,
zzfield3 LIKE ekpo-zzfield3 ,
date1(10),
date2(10),
date3(10),
date4(10),
date5(10),
date6(10),
date7(10),
END OF str.
DATA :package(10) TYPE n VALUE '4747'.
DATA :subpackage(10) TYPE n VALUE '4748'.
DATA : l_po_header LIKE bapimepoheader.
DATA : l_po_headerx LIKE bapimepoheaderx.
DATA : l_purchaseorder LIKE bapimepoheader-po_number.
DATA : t_po_account LIKE bapimepoaccount OCCURS 0 WITH HEADER LINE.
DATA : t_po_accountx LIKE bapimepoaccountx OCCURS 0 WITH HEADER LINE.
DATA : t_po_servalue LIKE bapiesklc OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF t_po_items OCCURS 0.
INCLUDE STRUCTURE bapimepoitem.
DATA : END OF t_po_items.
DATA : BEGIN OF t_po_itemsx OCCURS 0.
INCLUDE STRUCTURE bapimepoitemx.
DATA : END OF t_po_itemsx.
DATA : BEGIN OF t_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA : END OF t_return.
DATA : BEGIN OF t_po_services OCCURS 0.
INCLUDE STRUCTURE bapiesllc.
DATA : END OF t_po_services.
DATA: l_item(5) TYPE n,l_last_po(10).
*TABLES : zerror.
DATA lcounter(3) TYPE n.
DATA : l_errflag.
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME.
PARAMETER:x_lifnr LIKE ekko-lifnr .
PARAMETER:x_ekorg LIKE ekko-ekorg DEFAULT '9000' .
PARAMETER:x_ekgrp LIKE ekko-ekgrp .
PARAMETER:x_bukrs LIKE ekko-bukrs DEFAULT '0101' .
PARAMETER:x_bsart LIKE ekko-bsart DEFAULT 'ZNB1'.
PARAMETER:x_sdate LIKE ekko-bedat.
PARAMETER : x_edate LIKE ekko-bedat.
PARAMETER: pr_fn1 LIKE ibipparms-path OBLIGATORY.
PARAMETER: rad1 RADIOBUTTON GROUP gr1.
PARAMETER: rad2 RADIOBUTTON GROUP gr1.
PARAMETER: rad3 RADIOBUTTON GROUP gr1.
PARAMETER: rad4 RADIOBUTTON GROUP gr1.
PARAMETER: rad5 RADIOBUTTON GROUP gr1.
PARAMETER: rad6 RADIOBUTTON GROUP gr1.
PARAMETER: rad7 RADIOBUTTON GROUP gr1.
PARAMETER: rad8 RADIOBUTTON GROUP gr1.
SELECTION-SCREEN:END OF BLOCK b1 .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_fn1.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = pr_fn1.
MOVE pr_fn1 TO w_fname1.
START-OF-SELECTION.
IF rad1 = 'X'.
PERFORM table_upload TABLES itab1.
ELSEIF rad2 = 'X'.
PERFORM table_upload TABLES itab2.
ELSEIF rad3 = 'X'.
PERFORM table_upload TABLES itab3.
ELSEIF rad4 = 'X'.
PERFORM table_upload TABLES itab4.
ELSEIF rad5 = 'X'.
PERFORM table_upload TABLES itab5.
ELSEIF rad6 = 'X'.
PERFORM table_upload TABLES itab6.
ELSEIF rad7 = 'X'.
PERFORM table_upload TABLES itab7.
ELSEIF rad8 = 'X'.
PERFORM table_upload TABLES itab8.
ENDIF.
LOOP AT str.
SHIFT str-srvpos RIGHT DELETING TRAILING ' '.
OVERLAY str-srvpos WITH '00000000000000000'.
MODIFY str.
ENDLOOP.
CLEAR : l_po_header.
PERFORM create_po_header.
LOOP AT str FROM 2 .
PERFORM append_item.
ENDLOOP.
PERFORM create_po.
WAIT UP TO 5 SECONDS.
SELECT * FROM ekpo INTO CORRESPONDING FIELDS OF TABLE iekpo WHERE ebeln = l_purchaseorder.
COMMIT WORK.
WAIT UP TO 5 SECONDS.
LOOP AT iekpo.
l_item = sy-tabix + 1.
READ TABLE str INDEX l_item.
iekpo-zzfield2 = str-zzfield2 .
iekpo-zzfield3 = str-zzfield3 .
iekpo-zzformat = str-zzformat .
iekpo-zzmeansofad = str-zzmeansofad .
iekpo-zzedition = str-zzedition .
iekpo-zzcolorhue = str-zzcolorhue .
iekpo-zztypeofad = str-zztypeofad .
iekpo-zzcity = str-zzcity .
iekpo-zzlangu = str-zzlangu .
iekpo-zzdaysofwk = str-zzdaysofwk .
iekpo-zzasnum = str-zzasnum .
iekpo-zzlocationorroad = str-zzlocationorroad .
iekpo-zzcinemaname = str-zzcinemaname .
iekpo-zzcapacity = str-zzcapacity .
iekpo-zzcampaign = str-zzcampaign .
iekpo-zzillumination = str-zzillumination .
iekpo-zztrafficdirtn = str-zztrafficdirtn .
iekpo-zzstore = str-zzstore .
iekpo-zzcasting = str-zzcasting .
iekpo-zzgenre = str-zzgenre .
iekpo-zzsection = str-zzsection .
iekpo-zznumberofdays = str-zznumberofdays .
iekpo-zzprogramname = str-zzprogramname .
iekpo-zzdealstructure = str-zzdealstructure .
iekpo-zztimeband = str-zztimeband .
iekpo-zzdate = str-zzdate .
MODIFY iekpo.
ENDLOOP.
WAIT UP TO 2 SECONDS.
COMMIT WORK.
WAIT UP TO 15 SECONDS.
UPDATE ekpo FROM TABLE iekpo.
COMMIT WORK.
WAIT UP TO 2 SECONDS.
SELECT * FROM ekko INTO CORRESPONDING FIELDS OF TABLE iekko WHERE ebeln = l_purchaseorder.
LOOP AT iekko.
iekko-kdatb = x_sdate.
iekko-kdate = x_edate.
MODIFY iekko.
ENDLOOP.
UPDATE ekko FROM TABLE iekko.
COMMIT WORK.
WAIT UP TO 1 SECONDS.
CLEAR l_item.
l_item = 10.
LOOP AT str FROM 2 .
CONCATENATE str-date1+6(4) str-date1+3(2) str-date1(2) INTO wabldat1.
CONCATENATE str-date2+6(4) str-date2+3(2) str-date2(2) INTO wabldat2.
CONCATENATE str-date3+6(4) str-date3+3(2) str-date3(2) INTO wabldat3.
CONCATENATE str-date4+6(4) str-date4+3(2) str-date4(2) INTO wabldat4.
CONCATENATE str-date5+6(4) str-date5+3(2) str-date5(2) INTO wabldat5.
CONCATENATE str-date6+6(4) str-date6+3(2) str-date6(2) INTO wabldat6.
CONCATENATE str-date7+6(4) str-date7+3(2) str-date7(2) INTO wabldat7.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '001'.
ipodates-podat = wabldat1.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '002'.
ipodates-podat = wabldat2.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '003'.
ipodates-podat = wabldat3.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '004'.
ipodates-podat = wabldat4.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '005'.
ipodates-podat = wabldat5.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '006'.
ipodates-podat = wabldat6.
APPEND ipodates.
ipodates-ebeln = l_purchaseorder.
ipodates-ebelp = l_item.
ipodates-linno = '007'.
ipodates-podat = wabldat7.
APPEND ipodates.
l_item = l_item + 10.
ENDLOOP.
WAIT UP TO 1 SECONDS.
MODIFY zcta_podates FROM TABLE ipodates.
COMMIT WORK.
WAIT UP TO 2 SECONDS.
ipodates-podat,ipodates-ebeln,ipodates-ebelp,ipodates-linno.
WAIT UP TO 5 SECONDS.
LOOP AT t_return.
WRITE :/ t_return-message.
ENDLOOP.
free : ipodates,iekpo,str,itab1,itab2,itab3,itab4,itab5,itab6,itab7,itab8.
*& Form create_po_header
FORM create_po_header .
l_po_header-comp_code = '0101'. " Company Code
l_po_header-doc_type = x_bsart. "'ZNB1'. " Order Typr BSART
l_po_header-creat_date = sy-datum. " P.O Dt - BEDAT
l_po_header-doc_date = sy-datum.
l_po_header-vendor = x_lifnr.
l_po_header-vper_start = x_sdate.
l_po_header-vper_end = x_edate.
l_po_header-purch_org = '9000'. " Purch. Org - EKKO-EKORG
l_po_header-pur_group = x_ekgrp. " Purch Group - EKKO-EKGRP
l_po_header-currency_iso = 'INR'.
CLEAR : l_po_headerx.
l_po_headerx-po_number = 'X'.
l_po_headerx-comp_code = 'X'." Company Code
l_po_headerx-doc_type = 'X'. " Order Typr BSART
l_po_headerx-vendor = 'X'. "Vendor - EKKO-LIFNR
l_po_headerx-purch_org = 'X'. " Purch. Org - EKKO-EKORG
l_po_headerx-pur_group = 'X'. " Purch Group - EKKO-EKGRP
l_po_headerx-currency_iso = 'X'. " Currency Default field for Enjoy
l_po_headerx-ref_1 = 'X'.
ENDFORM. " create_po_header
*& Form APPEND_ITEM
FORM append_item .
package = package + 2.
subpackage = package + 1.
l_item = l_item + 10.
t_po_items-po_item = l_item.
t_po_items-acctasscat = 'K'.
t_po_items-item_cat = 'D'.
t_po_items-short_text = str-txz01. .
t_po_items-plant = str-werks . " P
t_po_items-tax_code = 'S1'.
t_po_items-pckg_no = package. " 4748. "package.
APPEND t_po_items.
CLEAR t_po_items.
t_po_itemsx-po_item = l_item.
t_po_itemsx-po_itemx = 'X'.
t_po_itemsx-acctasscat = 'X'.
t_po_itemsx-item_cat = 'X'.
t_po_itemsx-short_text = 'X'.
t_po_itemsx-plant = 'X'.
t_po_itemsx-tax_code = 'X'.
t_po_itemsx-pckg_no = 'X'.
APPEND t_po_itemsx.
CLEAR t_po_itemsx.
t_po_account-po_item = l_item.
t_po_account-serial_no = 1.
t_po_account-quantity = 1.
t_po_account-distr_perc = '00'.
t_po_account-costcenter = '0006079000'. " 'BR034'.
t_po_account-gl_account = '0054014071'. "'0000135075'.
t_po_account-co_area = '1001'.
APPEND t_po_account.
CLEAR t_po_account.
t_po_accountx-po_item = l_item.
t_po_accountx-serial_no = 1.
t_po_accountx-quantity = 'X'.
t_po_accountx-distr_perc = 'X'.
t_po_accountx-costcenter = 'X'.
t_po_accountx-gl_account = 'X'.
t_po_accountx-co_area = 'X'.
APPEND t_po_accountx.
CLEAR t_po_accountx.
t_po_services-pckg_no = package. "'4748'.
t_po_services-line_no = '0000000001' .
t_po_services-ext_line = '0000000000' .
t_po_services-outl_level = '0'.
t_po_services-outl_no = ' '.
t_po_services-outl_ind = 'X'.
t_po_services-subpckg_no = subpackage . "'4749'.
APPEND t_po_services. CLEAR t_po_services .
t_po_services-pckg_no = subpackage . "'4749'.
t_po_services-line_no = '0000000002' .
t_po_services-ext_line = '10' .
t_po_services-outl_level = '0'.
t_po_services-service = str-srvpos. "'000000000003000045'.
t_po_services-gr_price = str-gross. "'2000.00'.
t_po_services-form_val1 = str-val1. "'10.000'.
t_po_services-form_val2 = str-val2. "'33.000'.
if rad1 = 'x'.
t_po_services-form_val3 = str-val3. " '3.000'.
endif.
t_po_services-tax_code = 'S1'.
APPEND t_po_services. CLEAR t_po_services .
t_po_servalue-pckg_no = subpackage . "'4749'.
t_po_servalue-line_no = '0000000002' .
t_po_servalue-serial_no = '01'.
APPEND t_po_servalue . CLEAR t_po_servalue.
ENDFORM. " APPEND_ITEM
*& Form create_po
FORM create_po .
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = l_po_header
poheaderx = l_po_headerx
IMPORTING
exppurchaseorder = l_purchaseorder
TABLES
return = t_return
poitem = t_po_items
poitemx = t_po_itemsx
poaccount = t_po_account
poaccountx = t_po_accountx
poservices = t_po_services
posrvaccessvalues = t_po_servalue
WAIT UP TO 15 SECONDS.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDFORM. " create_po
*& Form TABLE_UPLOAD
FORM table_upload TABLES p_itab1. " structure < itab1 #local# >
"Insert correct name for <...>.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_fname1
filetype = 'ASC'
has_field_separator = 'X'
read_by_line = 'X'
replacement = '#'
TABLES
data_tab = p_itab1.
LOOP AT p_itab1.
MOVE-CORRESPONDING p_itab1 TO str.
APPEND str.
CLEAR p_itab1.
ENDLOOP.
* WAIT UP TO 5 SECONDS.
ENDFORM. " TABLE_UPLOADHi,
Check this sample code..how to use the BAPI_PO_CREATE1.
REPORT Z_TEST_PO .
*DATA DECLARATION
CONSTANTS : C_X VALUE 'X'.
*Structures to hold PO header data
DATA : HEADER LIKE BAPIMEPOHEADER ,
HEADERX LIKE BAPIMEPOHEADERX .
*Structures to hold PO account data
DATA : ACCOUNT LIKE BAPIMEPOACCOUNT OCCURS 0 WITH HEADER LINE ,
ACCOUNTX LIKE BAPIMEPOACCOUNTX OCCURS 0 WITH HEADER LINE .
*Internal Tables to hold PO ITEM DATA
DATA : ITEM LIKE BAPIMEPOITEM OCCURS 0 WITH HEADER LINE,
ITEMX LIKE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,
*Internal table to hold messages from BAPI call
RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
*Internal table to hold messages from BAPI call
POCONTRACTLIMITS LIKE BAPIESUCC OCCURS 0 WITH HEADER LINE.
DATA : W_HEADER(40) VALUE 'PO Header',
PURCHASEORDER LIKE BAPIMEPOHEADER-PO_NUMBER,
DELIVERY_DATE LIKE BAPIMEPOSCHEDULE-DELIVERY_DATE.
DATA : WS_LANGU LIKE SY-LANGU.
*text-001 = 'PO Header' - define as text element
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : COMPANY LIKE HEADER-COMP_CODE DEFAULT '122' ,
DOCTYP LIKE HEADER-DOC_TYPE DEFAULT 'NB' ,
CDATE LIKE HEADER-CREAT_DATE DEFAULT SY-DATUM ,
VENDOR LIKE HEADER-VENDOR DEFAULT '2000000012' ,
PUR_ORG LIKE HEADER-PURCH_ORG DEFAULT 'PU01' ,
PUR_GRP LIKE HEADER-PUR_GROUP DEFAULT '005' .
*sociedad like HEADER-COMP_CODE default '122' ,
*vendedor like HEADER-SALES_PERS default 'sale person'.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : ITEM_NUM LIKE ITEM-PO_ITEM DEFAULT '00010',
MATERIAL LIKE ITEM-MATERIAL DEFAULT '12000000' ,
TIPO_IMP LIKE ITEM-ACCTASSCAT DEFAULT 'K' ,
*pos_doc like ITEM-ITEM_CAT default 'F' ,
SHORTTXT LIKE ITEM-SHORT_TEXT DEFAULT 'PRUEBA BAPI' ,
GRUP_ART LIKE ITEM-MATL_GROUP DEFAULT '817230000' ,
PLANT LIKE ITEM-PLANT DEFAULT '3001' ,
MPE LIKE ITEM-TRACKINGNO DEFAULT '9999' ,
*contrato like ITEM-AGREEMENT default '4904000003' ,
*quantity like ITEM-QUANTITY default 1 .
PO_UNIT LIKE ITEM-PO_UNIT DEFAULT 'EA'.
SELECTION-SCREEN END OF BLOCK B2.
* Par?mnetros de imputaci?n
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-004.
PARAMETERS : CENTRO LIKE ACCOUNT-COSTCENTER DEFAULT '1220813150',
CUENTA LIKE ACCOUNT-GL_ACCOUNT DEFAULT '6631400' ,
NUM_POS LIKE ACCOUNT-PO_ITEM DEFAULT '10' ,
SERIAL LIKE ACCOUNT-SERIAL_NO DEFAULT '01' ,
IND_IMP LIKE ACCOUNT-TAX_CODE DEFAULT 'I2' .
SELECTION-SCREEN END OF BLOCK B3.
START-OF-SELECTION.
*DATA POPULATION
WS_LANGU = SY-LANGU. "Language variable
*POPULATE HEADER DATA FOR PO
*HEADER-COMP_CODE = sociedad .
HEADER-DOC_TYPE = DOCTYP .
HEADER-VENDOR = VENDOR .
HEADER-CREAT_DATE = CDATE .
HEADER-CREATED_BY = 'TD17191' .
HEADER-PURCH_ORG = PUR_ORG .
HEADER-PUR_GROUP = PUR_GRP .
HEADER-COMP_CODE = COMPANY .
HEADER-LANGU = WS_LANGU .
*HEADER-SALES_PERS = vendedor .
*HEADER-CURRENCY = 'DOP' .
*HEADER-ITEM_INTVL = 10 .
*HEADER-PMNTTRMS = 'N30' .
*HEADER-EXCH_RATE = 1 .
*POPULATE HEADER FLAG.
HEADERX-COMP_CODE = C_X.
HEADERX-DOC_TYPE = C_X.
HEADERX-VENDOR = C_X.
HEADERX-CREAT_DATE = C_X.
HEADERX-CREATED_BY = C_X.
HEADERX-PURCH_ORG = C_X.
HEADERX-PUR_GROUP = C_X.
HEADERX-LANGU = C_X.
*HEADERX-sales_pers = c_x.
*HEADERX-CURRENCY = c_x.
*HEADER-ITEM_INTVL = c_x.
*HEADER-PMNTTRMS = c_x.
*HEADER-EXCH_RATE = c_x.
*HEADER-EXCH_RATE = c_x.
*POPULATE ITEM DATA.
ITEM-PO_ITEM = ITEM_NUM.
ITEM-QUANTITY = '1'.
*ITEM-MATERIAL = material .
ITEM-SHORT_TEXT = 'prueba bapi_po_create1'.
*ITEM-TAX_CODE = ''.
ITEM-ACCTASSCAT = 'K' .
*ITEM-ITEM_CAT = 'D' .
ITEM-MATL_GROUP = '817230000' .
ITEM-PLANT = '3001' .
ITEM-TRACKINGNO = '99999'.
ITEM-PREQ_NAME = 'test'.
*ITEM-AGREEMENT = '' .
*ITEM-AGMT_ITEM = ''.
ITEM-QUANTITY = '1' .
ITEM-PO_UNIT = 'EA'.
*ITEM-ORDERPR_UN = 'EA'.
ITEM-CONV_NUM1 = '1'.
ITEM-CONV_DEN1 = '1'.
ITEM-NET_PRICE = '1000000' .
ITEM-PRICE_UNIT = '1'.
ITEM-GR_PR_TIME = '0'.
ITEM-PRNT_PRICE = 'X'.
ITEM-UNLIMITED_DLV = 'X'.
ITEM-GR_IND = 'X' .
ITEM-IR_IND = 'X' .
ITEM-GR_BASEDIV = 'X'.
*ITEM-PCKG_NO = '' .
APPEND ITEM. CLEAR ITEM.
*POPULATE ITEM FLAG TABLE
ITEMX-PO_ITEM = ITEM_NUM.
ITEMX-PO_ITEMX = C_X.
*ITEMX-MATERIAL = C_X.
ITEMX-SHORT_TEXT = C_X.
ITEMX-QUANTITY = C_X.
*ITEMX-TAX_CODE = C_X.
ITEMX-ACCTASSCAT = C_X.
*ITEMX-ITEM_CAT = c_x.
ITEMX-MATL_GROUP = C_X.
ITEMX-PLANT = C_X.
ITEMX-TRACKINGNO = C_X.
ITEMX-PREQ_NAME = C_X.
*ITEMX-AGREEMENT = C_X.
*ITEMX-AGMT_ITEM = c_x.
ITEMX-STGE_LOC = C_X.
ITEMX-QUANTITY = C_X.
ITEMX-PO_UNIT = C_X.
*ITEMX-ORDERPR_UN = C_X.
ITEMX-CONV_NUM1 = C_X.
ITEMX-CONV_DEN1 = C_X.
ITEMX-NET_PRICE = C_X.
ITEMX-PRICE_UNIT = C_X.
ITEMX-GR_PR_TIME = C_X.
ITEMX-PRNT_PRICE = C_X.
ITEMX-UNLIMITED_DLV = C_X.
ITEMX-GR_IND = C_X .
ITEMX-IR_IND = C_X .
ITEMX-GR_BASEDIV = C_X .
APPEND ITEMX. CLEAR ITEMX.
*POPULATE ACCOUNT DATA.
ACCOUNT-PO_ITEM = ITEM_NUM.
ACCOUNT-SERIAL_NO = SERIAL .
ACCOUNT-CREAT_DATE = SY-DATUM .
ACCOUNT-COSTCENTER = CENTRO .
ACCOUNT-GL_ACCOUNT = CUENTA .
ACCOUNT-GR_RCPT = 'tester'.
APPEND ACCOUNT. CLEAR ACCOUNT.
*POPULATE ACCOUNT FLAG TABLE.
ACCOUNTX-PO_ITEM = ITEM_NUM .
ACCOUNTX-PO_ITEMX = C_X .
ACCOUNTX-SERIAL_NO = SERIAL .
ACCOUNTX-SERIAL_NOX = C_X .
ACCOUNTX-CREAT_DATE = C_X .
ACCOUNTX-COSTCENTER = C_X .
ACCOUNTX-GL_ACCOUNT = C_X .
ACCOUNT-GR_RCPT = C_X.
APPEND ACCOUNTX. CLEAR ACCOUNTX.
*BAPI CALL
CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = HEADER
POHEADERX = HEADERX
IMPORTING
EXPPURCHASEORDER = PURCHASEORDER
TABLES
RETURN = RETURN
POITEM = ITEM
POITEMX = ITEMX
POACCOUNT = ACCOUNT
POACCOUNTX = ACCOUNTX.
*Confirm the document creation by calling database COMMIT
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
END-OF-SELECTION.
*Output the messages returned from BAPI call
LOOP AT RETURN.
WRITE / RETURN-MESSAGE.
ENDLOOP.
Regards
vijay
Maybe you are looking for
-
How do i open an e-mail attachment from WINDOWS
heres my question Someone approached me in church today,they know i have a Macbook They recieved an e-mail with an attachment from someone else they went to open the attachment,Right away Microsoft Office opened and told them their TRIAL had expired.
-
We are a small, private school that recently purchased 40 iPad minis to use in the classroom. We have been using Apple Configurator and iTunes to manage the free apps on the iPads. Now we would like to purchase some apps and I went through the step
-
JMS Durable Distributed Topics
Please forgive my ignorance if I am doing something silly. I am new to Weblogic and JMS, but learning a lot quickly. Any help will be greatly appreciated. I am running weblogic 8.1 with no service packs in a development
-
Issue with execution of J1INCERT
Dear All, I have executed-J1INCHLN - Create Remittance Challan & the challan is updated. Then executed -J1INBANK - Enter Bank Challan & the challan is also updated. While executing J1INCERT - Print the system displays list contains no data.Where i
-
Can you lighten videos in Quicktime?
I have some videos that, on my camera look fine, but when uploaded to the computer, are very dark. Is there any way I can lighten them up using Quicktime Pro?