Problem in uploading multiple PO line items thro bapi_po_create1...
Hi All,
I want to upload Purcase details thro BAPI_PO_create1.I am able to upload PO for single line item. If i pass multiple line items i am getting error.
Error is "Purchase order still contails faulty items".
Pls see my code,and help to solve this pls.Thanks in Advance.
*iTEM 1
ls_poitem-po_item = '00010'.
ls_poitemx-po_item = '00010'.
ls_poitemx-po_itemx = 'X'.
ls_poitem-material = '11C650004'.
ls_poitemx-material = 'X'.
ls_poitem-MATL_GROUP = '125'.
ls_poitemx-MATL_GROUP = 'X'.
LS_POITEM-STGE_LOC = '1101'.
LS_POITEMX-STGE_LOC = 'X'.
MATERIAL DESCRIPTION.
SELECT SINGLE MAKTX
FROM MAKT
INTO ls_poitem-short_text
WHERE MATNR = ls_poitem-material AND
SPRAS = 'EN'.
ls_poitemx-short_text = 'X'.
ls_poitem-quantity = '100'.
ls_poitemx-quantity = 'X'.
ls_poitem-po_unit = 'KG'.
ls_poitemx-po_unit = 'X'.
ls_poitem-po_unit_iso = 'KG'.
ls_poitemx-po_unit_iso = 'X'.
ls_poitem-net_price = '220.57'.
ls_poitemx-net_price = 'X'.
ls_poitem-price_unit = '1'.
ls_poitemx-price_unit = 'X'.
LS_POITEM-TAX_CODE = 'NT'.
LS_POITEMX-TAX_CODE = 'X'.
LS_POITEM-ACCTASSCAT = 'F'.
LS_POITEMX-ACCTASSCAT = 'X'.
ls_poitem-plant = '1100'.
ls_poitemx-plant = 'X'.
APPEND : ls_poitem TO gt_poitem,
ls_poitemx TO gt_poitemx.
CLEAR:LS_POITEM,LS_POITEMX.
ITEM 2
ls_poitem-po_item = '00020'.
ls_poitemx-po_item = '00020'.
ls_poitemx-po_itemx = 'X'.
ls_poitem-material = '11C650003'.
ls_poitemx-material = 'X'.
MATERIAL DESCRIPTION.
SELECT SINGLE MAKTX
FROM MAKT
INTO ls_poitem-short_text
WHERE MATNR = ls_poitem-material AND
SPRAS = 'EN'.
ls_poitemx-short_text = 'X'.
ls_poitem-quantity = '100'.
ls_poitemx-quantity = 'X'.
ls_poitem-po_unit = 'KG'.
ls_poitemx-po_unit = 'X'.
ls_poitem-po_unit_iso = 'KG'.
ls_poitemx-po_unit_iso = 'X'.
ls_poitem-net_price = '230.57'.
ls_poitemx-net_price = 'X'.
ls_poitem-price_unit = '1'.
ls_poitemx-price_unit = 'X'.
LS_POITEM-TAX_CODE = 'NT'.
LS_POITEMX-TAX_CODE = 'X'.
LS_POITEM-ACCTASSCAT = 'F'.
LS_POITEMX-ACCTASSCAT = 'X'.
ls_poitem-plant = '1100'.
ls_poitemx-plant = 'X'.
APPEND : ls_poitem TO gt_poitem,
ls_poitemx TO gt_poitemx.
CLEAR:LS_POITEM,LS_POITEMX.
Hi Sree,
Thanks for ur reply. After i passed storage location the PO is created.
One more problem is multiple schedule line is not created.It considers only the first line alone.
If possible can u pls give some ideas to solve the problem
Thanks.
Similar Messages
-
LSMW upload of vendor line items
Hi
I have prepared a template for vendor line item upload. For payments as well as invoice. Now when i upload, i want that it should automatically get knocked off.
For example:
There is a vendor invoice - Rs.100
Advance - Rs.40
Now when i upload both the line item, SAP should automatically show Rs. 100 & Rs.40 cleared with each other and Rs. 60 must be shown as open item.
Is there any link available for upload ?Hi Max Tan,
a) You will probably only be able to use multiple T-Codes in one of the Standard uploads provided by SAP.In these you have to enter the T-Code to be used, so therefore you could code it to use different T-codes. A recording would not allow this.
b) Multiple in Sequence is just a design issue not any specific function. In reality they are seperate programms, but i use the same source file with coding to decide which items are used in each programm.
eg for Asset uploads- I have a single file but 2 programms.
a) Programm for main Asset numbers - Code If Sub-no NE 0.
Skip_Record.
b) Programm for Sub Asset numbers Code If Sub-no = 0
Skip_Record.
In this case i have to run a) before b), therefore "in sequence".
KInd regards -
BAPI_PO_CREATE1 for Multiple service line items
Hi Exports,
I am using BAPI_PO_CREATE1 to create service PO. I am facing problem when each line item(ebelp) has multiple service line items. I am unable to map multiple service line items to a single line item (ebelp) properly.
Can anyone help.
Regards,
KiranHi ,
I am able to create service PO when only one service line item is there.
If multiple service line items are there. then i have to put the below code with in the loop.
here i am facing the probelm.
w_poservices-pckg_no = g_pckg.
w_poservices-line_no = g_pckg.
w_poservices-outl_ind = c_x.
w_poservices-subpckg_no = g_pckg + 1.
w_poservices-service = w_sdata-srvpos.
w_poservices-short_text = w_idata-ktext1.
w_poservices-quantity = w_idata-menge.
w_poservices-base_uom = w_idata-meins.
w_poservices-gr_price = w_idata-tbtwr.
w_poservices-matl_group = w_idata-matkl.
APPEND w_poservices TO i_poservices.
CLEAR: w_poservices.
w_poservices-pckg_no = g_pckg + 1.
w_poservices-line_no = g_pckg + 1.
w_poservices-ext_line = 0000000010.
w_poservices-outl_ind = c_x.
w_poservices-subpckg_no = g_pckg + 2.
w_poservices-service = w_sdata-srvpos.
w_poservices-short_text = w_sdata-ktext1.
w_poservices-quantity = w_sdata-menge.
w_poservices-base_uom = w_sdata-meins.
w_poservices-gr_price = w_sdata-tbtwr.
w_poservices-matl_group = w_idata-matkl.
APPEND w_poservices TO i_poservices.
CLEAR: w_poservices.
w_posrvaccessvalues-pckg_no = g_pckg + 1.
w_posrvaccessvalues-line_no = g_pckg + 1.
w_posrvaccessvalues-serno_line = 01.
w_posrvaccessvalues-serial_no = 01.
w_posrvaccessvalues-quantity = w_idata-menge.
APPEND w_posrvaccessvalues TO i_posrvaccessvalues.
thank you.
Regards,
Kiran -
Service PO with Multiple service Line Items
Hi,
i am working on Service Po Creation by using BAPI BAPI_PO_CREAT1. I am able to create service for multiple line items but the problem is single line item my have multiple service line items in that case my object is not working. Can any one suggest solution for this.Here i am attachng what i written logic
T_POITEM-PCKG_NO = V_PACKNO.
T_POSERVICE-PCKG_NO = V_PACKNO. "'0000000001'.
T_POSERVICE-LINE_NO = V_LINENO. "'0000000001'.
T_POSERVICE-OUTL_IND = 'X'.
T_POSERVICE-EXT_LINE = '0'. "V_EXTLIN. "'0'.
T_POSERVICE-OUTL_LEVEL = '0'. "V_EXTOUT. "'0'.
T_POSERVICE-SUBPCKG_NO = V_PACKNO + 1. "'0000000003'. "(Dummy No.)
T_POSERVICE-QUANTITY = ITAB-SERV_QUANTITY.
T_POSERVICE-BASE_UOM = ITAB-BASE_UOM.
T_POSERVICE-PRICE_UNIT = '1'.
T_POSERVICE-GR_PRICE = ITAB-GR_PRICE.
T_POSERVICE-SHORT_TEXT = ITAB-SERV_TEXT. "'SERVICE TEST'.
APPEND T_POSERVICE.
V_LINENO = V_LINENO + 1.
* V_PACKNO = V_SUBPACKNO.
T_POSERVICE-PCKG_NO = V_PACKNO + 1.
T_POSERVICE-LINE_NO = V_LINENO.
T_POSERVICE-EXT_LINE = V_EXTLIN + 10. "'0'.
T_POSERVICE-OUTL_LEVEL = '0'. "V_EXTOUT. "'0'.
T_POSERVICE-OUTL_IND = SPACE.
T_POSERVICE-QUANTITY = ITAB-SERV_QUANTITY.
T_POSERVICE-SUBPCKG_NO = '0000000000'.
T_POSERVICE-BASE_UOM = ITAB-BASE_UOM.
T_POSERVICE-PRICE_UNIT = '1'.
T_POSERVICE-GR_PRICE = ITAB-GR_PRICE.
T_POSERVICE-SHORT_TEXT = ITAB-SERV_TEXT. "'SERVICE 1'.
T_POSERVICE-PLN_PCKG = V_PACKNO + 1.
T_POSERVICE-PLN_LINE = V_LINENO.
* T_POSERVICE-MATL_GROUP = '0082'.
APPEND T_POSERVICE.
* SET PCKG_NO AS SUB_PCKG_NO IN TABLE POSRVACCESSVALUES THIS:
T_POSERVALUE-PCKG_NO = V_PACKNO + 1. "'0000000003'.
T_POSERVALUE-LINE_NO = V_LINENO.
T_POSERVALUE-SERNO_LINE = '01'. "'01'.
T_POSERVALUE-SERIAL_NO = '01'. " '01'.
T_POSERVALUE-QUANTITY = ITAB-SERV_QUANTITY. "'10.000'.
APPEND T_POSERVALUE.by following instructions in 420332 note.
-
Service Procurement with Multiple Service Line items
Dear Experts,
We have the following Business Scenario. Request your inputs in addressing this issue.
Business scenario : Most of the Procurement for our client is of services. So, we need to configure services with multiple service line items. This Shopping cart to create PR in ECC. PR to PO conversion to take place in ECC. Now onwards client needs Supplier integration for confirmation of services and sending invoices by Vendor.
Guidance required in the following
1 In Shop functionality if we select services, PR is being created in ECC with only one Service Line item. Whereas if we go for Request functionality, then always it is routing to Bidding process (which is not required for client). Can we create SC with multiple service line items with out request functionality?? Or Can we root the Request functionality with out Bidding process??
2 If we convert the PR to PO in ECC (Classic Scenario), can we go for SUS integration. In such case which is the best way of supplier integration. Can you please guide us on basic steps on installation (can we go for different client in the same server) and configuration.
Request your inputs in this regard
Thank you,
RaviHello,
We suffered the same problem in our company. We have found a way to work with the SRM shopping cart multiple line rollup to ECC single line purchase order.
If the multiple shopping cart line items contain the same location code and cost assignment they will rollup into one ECC purchase order. The system seems to 'think' it is helping you by consolidating your information.
In the Basic Data section of the shopping cart there is a Service line item field. If you enter something in each in that field for each line it will keep it's own line in ECC.
Your implementation may differ slightly from ours but I recommend playing with the location code, cost assignment and Basic Data service line fields until you can see a pattern. Basically you need to find a method to make each line a separate entity so they don't rollup.
Good luck,
Corinne -
How to upload sales order line items?
SAPGurus,
For years my customer service department has been asking for a way to upload sales order line items into the VA01 sales order-entry screen.
Many of our customers submit PO's with huge amount of line items, up to 1,000 lines. Our CS reps need to key in the data line by line (or copy/paste
approx 17 lines at once from Excel into the VA01 screen), and we are looking for a way to make this process leaner. One idea we have is that user creates the order header, and then has a way to upload the material numbers and quantities in a separate (newly created Z-transaction) screen in one go.
Obviously rules then need to be built that deal with the various pop-up messages related to e.g. ATP, material status, etc.
Does anyone have any experience or thoughts on how we could achieve this? A way to make the sales order-entry process a bit less time-consuming? Any feedback would be greatly appreciated !
Thank you,
RVSTake the inputs from this Blog created by SUNIL PILLAI
Sales Documents upload using Standard Direct Input Program in LSMW
G. Lakshmipathi -
RFFOAVIS_FPAYM: Is this print program will support multiple PO line items
Hi, I am using the print program:<b>RFFOAVIS_FPAYM</b> and customized layout of: <b>F110_IN_AVIS</b>. I am able to get multiple Document numbers but I am not getting the multiple PO line items for each Document no. I had called the perform statement in text element : <b>625</b> in Main window.
Can you suggest how to modify the standard print program to our requirement. Where we need to
[code][code][code]<b>declare the text element</b>
[/code][/code][/code], Where we will declare the <u><b>internal table for getting the PO line items.</b></u>
Thanks & Regards
MadhuAmar,
You can create a PO with multiple line item, but you can not create the PO with multiple currency.
Regards,
Manish -
Percentage wise Confirmation for Multiple Service line items
Hi,
Percentage wise Confirmation for Multiple Service line items
During doing service entry sheet am able to do % wise confirmaion from
Menu -> Entry Sheet -> Create -> With Planned Service -> Enter Percent.
But this works only for single line item the first line.
If we have multiple line items & if i give 10%, It calculates 10% for
all items.
We want Line wise % confirmation can be given as % confirmation will differ from
line to line.
Thanks
ShashankDear ,
This percentage is a header data i.e applicable for all service items
F1 help clearly says
Percentage quantity to be adopted
Use
If you wish to adopt the planned services from the purchase order, you
can enter an additional percentage in this field in order to have that
percentage adopted instead of the total quantity shown in the purchase
order.
Example:
Quantity specified.............Quantity to be adopted:.............Quantity specified "
in purchase order:....................... 10 %..................................entry sheet:
Service 1.......100 pc ................................................................10 pc
Service 2.......200 m ............................................................... 20 m
Service 3. .....30 h ................................................................. 3 h
Edited by: redriver on Jan 22, 2012 6:50 AM -
Problem in uploading multiple line items while Creating sales order by BAPI
Hi experts , Im able to create sales order with one item while using this program, but the problem is when iam having multiple items or multiple sales order , iam not able to createthe line items , though its creating sales order header , Iam copy pasting my code , please add the additional code to my code to take more than 1 line items ,This is urgent requirement . Points will be rewarded for answers , Thanks in advance
*& Report Z_SO_CREATE_BAPI
REPORT Z_SO_CREATE_BAPI.
DATA: i_header TYPE bapisdhd1 occurs 0 with header line.
DATA: i_details TYPE bapisditm OCCURS 0 WITH HEADER LINE.
DATA: i_partner TYPE bapiparnr OCCURS 0 WITH HEADER LINE.
DATA: i_return1 TYPE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: i_return2 TYPE bapiret2.
data : ORDER_HEADER_IN like BAPISDHD1.
data : ORDER_ITEMS_IN like BAPISDITM occurs 0 with HEADER LINE .
data : ORDER_ITEMS_INX Like BAPISDITMX occurs 0 with HEADER LINE .
data : RETURN like BAPIRET2 occurs 0 with header line.
data : ORDER_PARTNERS like BAPIPARNR occurs 0 with
header line.
DATA : ORDER_KEYS LIKE BAPISDKEY OCCURS 0 WITH HEADER
LiNE.
data : ORDER_SCHEDULES_IN like BAPISCHDL occurs 0 with
header line.
data : ORDER_SCHEDULES_INX like BAPISCHDLX occurs 0 with
header line.
data : BEGIN OF TAB OCCURS 0,
SRNO(4),
DOC_TYPE like ORDER_HEADER_IN-dOC_TYPE,
SALES_ORG LIKE ORDER_HEADER_IN-SALES_ORG,
DISTR_CHAN LIKE ORDER_HEADER_IN-DISTR_CHAN,
DIVISION like ORDER_HEADER_IN-DIVISION,
REQ_DATE_H(10),
PURCH_DATE(10),
PMNTTRMS LIKE ORDER_HEADER_IN-PMNTTRMS,
PURCH_NO_C LIKE ORDER_HEADER_IN-PURCH_NO_C,
ITM_NUMBER like BAPISDITM-ITM_NUMBER,
MATERIAL LIKE ORDER_ITEMS_IN-MATERIAL ,
PLANT LIKE ORDER_ITEMS_IN-PLANT,
TARGET_QTY LIKE ORDER_ITEMS_IN-TARGET_QTY,
ITM_NUMBERX like ORDER_ITEMS_INX-ITM_NUMBER ,
MATERIALX LIKE ORDER_ITEMS_INX-MATERIAL ,
CUST_MAT22 LIKE ORDER_ITEMS_IN-CUST_MAT22,
PLANTX LIKE ORDER_ITEMS_INX-PLANT,
TARGET_QTYX LIKE ORDER_ITEMS_INX-TARGET_QTY,
ITM_NUMBER LIKE ORDER_ITEMS_IN-ITM_NUMBER,
MATERIAL LIKE ORDER_ITEMS_IN-MATERIAL ,
PARTN_ROLE LIKE ORDER_PARTNERS-PARTN_ROLE,
PARTN_NUMB LIKE ORDER_PARTNERS-PARTN_NUMB,
END OF TAB.
DATA: v_vbeln TYPE bapivbeln-vbeln.
selection-screen begin of block b1 with frame.
skip 3.
parameter:p_infile like rlgrap-filename obligatory.
skip 3.
selection-screen end of block b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
PERFORM value_help.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_infile
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = tab.
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
**Validation for the Create SO screen
*AT SELECTION-SCREEN ON BLOCK na_create.
Loop at Tab.
i_header-doc_type = TAB-DOC_TYPE .
i_header-sales_org = TAB-SALES_ORG.
i_header-distr_chan = TAB-DISTR_CHAN .
i_header-division = TAB-DIVISION .
append i_header.
*endloop.
i_partner-partn_role = TAB-PARTN_ROLE .
i_partner-partn_numb = TAB-PARTN_NUMB.
APPEND i_partner.
i_details-material = TAB-MATERIAL .
APPEND i_details.
endloop.
*Bapi for Creating SO
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN = v_vbeln
order_header_in = i_header
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = v_vbeln
tables
RETURN = i_return1
ORDER_ITEMS_IN = i_details
ORDER_ITEMS_INX = ORDER_ITEMS_INX
order_partners = i_partner .
ORDER_SCHEDULES_IN =
ORDER_SCHEDULES_INX =
ORDER_CONDITIONS_IN =
ORDER_CONDITIONS_INX =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
ORDER_TEXT =
ORDER_KEYS =
EXTENSIONIN =
PARTNERADDRESSES =
IF NOT v_vbeln IS INITIAL.
*Bapi Commit Work
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
return = i_return2
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
RETURN =
ENDIF.
LOOP AT i_return1 . "INTO wa_return1.
WRITE:/ i_return1-message.
ENDLOOP.
FORM value_help .
CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = ',.,..'
MODE = 'O'
TITLE = ' '
IMPORTING
FILENAME = p_infile
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform.
txt file data
order type salesorg distch divison materialno parter role
TA PB01 01 00 000000000000000852 WE
Partner no
8101000000Hi Neerja,
you can reffer this sample code. It may not be complet soluation for your poblem,
but you will get some idea.
*& Report ZBAPI_SALESORDER_CREATE
*& Author : Karthik
REPORT ZBAPI_SALESORDER_CREATE.
data : ORDER_HEADER_IN like BAPISDHD1.
data : ORDER_ITEMS_IN like BAPISDITM occurs 0 with
header line.
data : RETURN like BAPIRET2 occurs 0 with header line.
data : ORDER_PARTNERS like BAPIPARNR occurs 0 with
header line.
DATA : ORDER_KEYS LIKE BAPISDKEY OCCURS 0 WITH HEADER
LINE.
data : ORDER_SCHEDULES_IN like BAPISCHDL occurs 0 with
header line.
data : BEGIN OF TAB OCCURS 0,
SRNO(4),
DOC_TYPE like ORDER_HEADER_IN-dOC_TYPE,
SALES_ORG LIKE ORDER_HEADER_IN-SALES_ORG,
DISTR_CHAN LIKE ORDER_HEADER_IN-DISTR_CHAN,
DIVISION like ORDER_HEADER_IN-DIVISION,
REQ_DATE_H(10),
PURCH_DATE(10),
PMNTTRMS LIKE ORDER_HEADER_IN-PMNTTRMS,
PURCH_NO_C LIKE ORDER_HEADER_IN-PURCH_NO_C,
ITM_NUMBER like BAPISDITM-ITM_NUMBER,
CUST_MAT22 LIKE ORDER_ITEMS_IN-CUST_MAT22,
PLANT LIKE ORDER_ITEMS_IN-PLANT,
TARGET_QTY LIKE ORDER_ITEMS_IN-TARGET_QTY,
PARTN_ROLE LIKE ORDER_PARTNERS-PARTN_ROLE,
PARTN_NUMB LIKE ORDER_PARTNERS-PARTN_NUMB,
END OF TAB.
data: itab1 like alsmex_tabline occurs 0 with header
line.
DATA: gd_currentrow type i.
data : PURCHASEORDER like ekko-ebeln.
Data: tot_rec type i, "Total Records
gd_update type i, "Main Table Increement Counter
gd_lines type i, "Success Table increement Counter
w_textout like t100-text. "VARIABLE TO GET ERRORLOG
data : begin of it_success occurs 0,
SALESDOCUMENT LIKE BAPIVBELN-VBELN, "PROJECT
end of it_success.
data : begin of it_error occurs 0,
srno(4),
err_msg(73) TYPE c, "TO RETREIVE ERROR MESSAGES
end of it_error.
data : srno(4).
DATA : SALESDOCUMENT LIKE BAPIVBELN-VBELN.
selection-screen begin of block b1 with frame.
skip 3.
parameter:p_infile like rlgrap-filename obligatory.
skip 3.
selection-screen end of block b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_infile.
PERFORM value_help.
start-of-selection.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_infile
i_begin_col = '1'
i_begin_row = '2' "Do not require
headings
i_end_col = '22'
i_end_row = '10000'
TABLES
intern = itab1
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
others = 3.
if sy-subrc <> 0.
message e010(zz) with text-001. "Problem uploading
Excel Spreadsheet
endif.
*perform open_group.
sort itab1 by row col.
Get first row retrieved
read table itab1 index 1.
Set first row retrieved to current row
gd_currentrow = itab1-row.
loop at itab1.
Reset values for next row
if itab1-row ne gd_currentrow.
append tab .
clear tab.
gd_currentrow = itab1-row.
endif.
SHIFT ITAB1-VALUE LEFT DELETING LEADING SPACE.
case itab1-col.
when '0001'.
TAB-SRNO = itab1-value.
when '0002'.
TAB-DOC_TYPE = itab1-value.
when '0003'.
TAB-SALES_ORG = itab1-value.
when '0004'.
TAB-DISTR_CHAN = itab1-value.
when '0005'.
TAB-DIVISION = itab1-value.
when '0006'.
TAB-REQ_DATE_H = itab1-value.
when '0006'.
TAB-PURCH_DATE = itab1-value.
when '0007'.
TAB-PMNTTRMS = itab1-value.
when '0008'.
TAB-PURCH_NO_C = itab1-value.
when '0009'.
TAB-ITM_NUMBER = itab1-value.
when '0010'.
TAB-CUST_MAT22 = itab1-value.
when '0011'.
TAB-PLANT = itab1-value.
when '0012'.
TAB-TARGET_QTY = itab1-value.
when '0013'.
TAB-PARTN_ROLE = itab1-value.
when '0014'.
TAB-PARTN_NUMB = itab1-value.
endcase.
endloop.
append tab.
clear tab.
sort tab by SRNO.
LOOP AT TAB.
concatenate tab-REQ_DATE_H+4(4)
tab-REQ_DATE_H2(2) tab-REQ_DATE_H0(2) into
tab-REQ_DATE_H.
concatenate tab-PURCH_DATE+4(4)
tab-PURCH_DATE2(2) tab-PURCH_DATE0(2) into
tab-PURCH_DATE.
SRNO = TAB-SRNO.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = tab-PARTN_NUMB
IMPORTING
OUTPUT = tab-PARTN_NUMB.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = tab-CUST_MAT22
IMPORTING
OUTPUT = tab-CUST_MAT22.
IF TAB-SRNO = SRNO.
ORDER_HEADER_IN-DOC_TYPE = TAB-DOC_TYPE.
ORDER_HEADER_IN-SALES_ORG = TAB-SALES_ORG.
ORDER_HEADER_IN-DISTR_CHAN = TAB-DISTR_CHAN.
ORDER_HEADER_IN-REQ_DATE_H = TAB-REQ_DATE_H.
ORDER_HEADER_IN-PURCH_DATE = TAB-PURCH_DATE.
ORDER_HEADER_IN-PMNTTRMS = TAB-PMNTTRMS.
ORDER_HEADER_IN-PURCH_NO_C = TAB-PURCH_NO_C.
ORDER_HEADER_IN-DIVISION = tab-DIVISION.
ORDER_ITEMS_IN-ITM_NUMBER = tab-ITM_NUMBER.
ORDER_ITEMS_IN-material = TAB-CUST_MAT22.
ORDER_ITEMS_IN-PLANT = TAB-PLANT.
APPEND ORDER_ITEMS_IN.
ORDER_PARTNERS-PARTN_ROLE = TAB-PARTN_ROLE.
ORDER_PARTNERS-PARTN_NUMB = TAB-PARTN_NUMB.
APPEND ORDER_PARTNERS.
ORDER_SCHEDULES_IN-ITM_NUMBER = tab-ITM_NUMBER.
ORDER_SCHEDULES_IN-REQ_QTY = tab-TARGET_QTY.
append ORDER_SCHEDULES_IN.
ENDIF.
AT END OF SRNO.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
ORDER_HEADER_IN = ORDER_HEADER_IN
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = SALESDOCUMENT
TABLES
RETURN = RETURN
ORDER_ITEMS_IN = ORDER_ITEMS_IN
ORDER_ITEMS_INX =
ORDER_PARTNERS = ORDER_PARTNERS
ORDER_SCHEDULES_IN = ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX =
ORDER_CONDITIONS_IN =
ORDER_CONDITIONS_INX =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
ORDER_TEXT =
ORDER_KEYS = ORDER_KEYS
EXTENSIONIN =
PARTNERADDRESSES =
IF SALESDOCUMENT <> SPACE.
commit work.
ADD 1 TO gd_update.
it_success-SALESDOCUMENT = SALESDOCUMENT.
append it_success.
CLEAR :SALESDOCUMENT,ORDER_HEADER_IN.
REFRESH : RETURN,ORDER_ITEMS_IN,ORDER_PARTNERS.
ELSE.
loop at return.
it_error-SRNO = tab-SRNO.
it_error-err_msg = return-MESSAGE .
Append it_error.
ENDLOOP.
CLEAR :SALESDOCUMENT,ORDER_HEADER_IN.
REFRESH : RETURN,ORDER_ITEMS_IN,ORDER_PARTNERS.
ENDIF.
endat.
endloop.
DESCRIBE TABLE it_success LINES gd_lines.
IF gd_lines GT 0.
Display result report column headings
PERFORM display_column_headings.
Display result report
PERFORM DISPLAY_SUCESS.
ENDIF.
IF SUCESS FAILS Display Error Report
DESCRIBE TABLE it_error LINES gd_lines.
IF gd_lines GT 0.
PERFORM errorheadings.
PERFORM errorreport.
ENDIF.
*& Form display_column_headings
text
FORM display_column_headings.
WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
SKIP.
WRITE:2 'The following records inserted
successfully:'(013).
WRITE:/ sy-uline(15).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'Sales order'(004), sy-vline.
WRITE:/ sy-uline(15).
ENDFORM. "display_column_headings
*Subroutine to display SUCESS REPORT
FORM DISPLAY_SUCESS.
FORMAT COLOR COL_NORMAL.
LOOP AT it_success.
WRITE:/ sy-vline,
(10) it_success-SALESDOCUMENT, sy-vline.
CLEAR it_success.
ENDLOOP.
WRITE:/ sy-uline(15).
REFRESH: it_success.
FORMAT COLOR COL_BACKGROUND.
ENDFORM. "
DISPLAY_REPORT
*& Form errorreport
text
FORM errorreport.
LOOP AT it_error.
WRITE:/ sy-vline,
(10) it_error-SRNO, sy-vline,
(40) it_error-err_msg, sy-vline.
ENDLOOP.
WRITE:/ sy-uline(104).
REFRESH: it_error.
endform. "errorreport
*& Form ERRORHEADINGS
text
FORM ERRORHEADINGS.
SKIP.
WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
SKIP.
WRITE:2 'The following records failed during
update:'(008).
WRITE:/ sy-uline(104).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'ERROR.'(009), sy-vline.
WRITE:/ sy-uline(104).
FORMAT COLOR COL_NORMAL.
ENDFORM. "ERRORHEADINGS
**& Form value_help
text
--> p1 text
<-- p2 text
FORM value_help .
CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = ',.,..'
MODE = 'O'
TITLE = ' '
IMPORTING
FILENAME = p_infile
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. "value_help
Regards,
Amit. -
Cheque print out for vendor multiple open line items
HI experts,
I want to print a cheque using f-58 for vendor payment.The problem is when i click the vendor open items(vendor invoice) for a single line item its getting displayed.But when i click for vendor multiple open items(invoices) its not getting displayed in the script out put.Its displaying only with single document number(posting).thank you..its solved
-
Multiple Vendor Line item in FB60
Hi Friends,
It may be simple question but I stucked with it.
I want to split a Vendor Invoice document in FB60(Enjoy Transactions.) by using special Indicator for Retention amount.
You will be clear from below example :---
Inventory Rawmaterial a/c DR 1,00,000
TO Vendor a/c 90,000
TO Vendor a/c(Special GL a.c) 10,000
I need to post above document in FB60 but not F-43.
Here my question is how to split vendor line items while posting of document in FB60.
Thanks in advance.
Kiran KonujulaHi Kiran,
In my previous project we had retention and we have created payment term with installment payment.this will solve your problem.
Goto OBB8 T.code and create a payment term with installment payment (check this check box) and then goto OBB9 t.code to configure installment.
enter as follow
payment term installment percentage
0001 1 90
0001 2 10
do the testing and let me know if you need some more information.
Thanks,
Rau -
Multiple vendor line items in MIR7
Hi,
Is there a way that I can post various vendor line items in MIR7 like the one in FB60 which is via complex posting?
Thanks,
Chaikaru>
chaikaru wrote:
> Hi,
>
> Is there a way that I can post various vendor line items in MIR7 like the one in FB60 which is via complex posting?
>
> Thanks,
> Chaikaru
Yes why not, if you are doing invoicing against multiple line items, you can assign each line to different vendor, to accomplish this, you need to click on DETAILS tab of invoice header and in INV.PARTY put in the vendor number and save.
Same process you do with other line with different vendor number.
Edited by: Afshad Irani on Jun 3, 2010 4:04 PM
Edited by: Afshad Irani on Jun 3, 2010 4:04 PM -
Multiple vendor line items during IR with different withholding tax status
Business scenario: During IR, several vendor line items are being processed, some are stock materials, others are service materials (using material group). Only the service materials are subject to withholding tax.
Problem: Since the withholding tax type/code is maintained at the company code level of the vendor master, it is not possible to select only the service materials as subject to withholding tax.
Has anyone encountered this problem before? if yes, please advise solution adopted.
Thanks.I think through condition type / condition record, you can reduce the amount payable to the vendor and post it to another GL account. But if you do not update the amount in the W/tax base and w/tax amount, you will not be able to use standard reports of w/tax. May be condition types can be used to do the calculation of w/tax amount and w/tax base amount. Build the logic in the interfcae of e-invoice and SAP to update W/tax fields in vendor invoice.
-
Auto project triggering when multiple FG line item's in sales order
Dear Friends,
I am working on engineering project scenario mainly all are the Customer projects.
Basically my client executes Customer projects for Establishing Dairy Plant, Pharma Plant, and Chemical Plant. For that they manufacture various FG assemblies & delivers to Customer site & accordingly Billing will be done to Customer.
Here my area of concern is for any single customer project for Ex. u201CSetting up Dairy Plantu201D requires multiple FG assemblies. For example in this case 20 FG assemblies to be manufactured & delivered to customer & accordingly billing will be done.
By using strategy group u201C21u201D Make-to-order prod. / Project settlement Can is it possible to trigger the project at sales order level with multiple FG assemblies as a multiple line items in sales order. For example, 20 FG assemblies.
If it is possible then what are the prerequisite configurations needs to be done from PS, SD & MM module.
I think strategy group u201C85u201D Assembly processing with network/project will not be applicable in above scenario. This strategy group is applicable for single FG line item in Sales Order not for multiple line items.
Kindly guide me how to overcome from above scenario.
Thanks & Regards,
PrasadHi Ahmed,
Thanks for quick response....
Can you explore about strategy u201C21u201D Make-to-order prod. / Project settlement.
By using strategy group u201C21u201D Make-to-order prod. / Project settlement Can is it possible to trigger the project at sales order level with multiple FG assemblies as a multiple line items in sales order. For example, 20 FG assemblies.
If it is possible then what are the prerequisite configurations needs to be done from PS, SD & MM module
Thanks & Regards,
Sandeep -
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
Maybe you are looking for
-
Itunes won't install on my windows 7, 64 bit puter.
itunes won't install on my windows 7, 64 bit puter. Repeated tries. It rolls back and cancels midstream.
-
Presenting Keynote via AirPlay Mirroring Limitations
I just finished an annual awards banquet where I display a Keynote presentation on two screens and thought I'd share my experience. The presentation is on my MacBook Pro, and this year, instead of running cables to both projectors, I tried running on
-
Calendar Range of Dates Order By doesn't Seem to be Working
I have the following query: select cdate,to_char(insdate,'DDMONRR:HH24:MI:SS'),room,no, (CASE when no = 1 then '*'||room||'*' when no = 2 then '*'||room||'*' when no = 3 then '*'||room||'*' when no = 4 then '*'||room||'*' else '*'||room||'*' end) COL
-
Is An External DVD Burner Needed To Reduce Burn Time?
I burned a DVD consisting of 400 photos with added music from iTunes but took nearly 2 hours. In the book "iLife '06" Michael Rubin suggests an Apple SuperDrive or compatible third-party DVD burner for burning DVD's as the minimum system requirements
-
I'm trying to create a nested style in In Copy CS5. What I want for it to do is to create the first few words with a certain character style then revert back to the Paragraph style setting. I have the nested style set to end with the end nested style