Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sales Order Creation using BAPI

Former Member
0 Likes
2,080

Hi all,

Im creating Sales Order using BAPI_SALESORDER_CREATEFROMDAT2 Function Module. using this FM i need to populate Item configuration detail also. for that i have to populate following 4 TABLES.

ORDER_CFGS_REF LIKE BAPICUCFG

ORDER_CFGS_INST LIKE BAPICUINS

ORDER_CFGS_PART_OF LIKE BAPICUPRT

ORDER_CFGS_VALUE LIKE BAPICUVAL

i found OSS Note 549563, which is helpful to me and accordingly i have populate all four tables but still i am getting following error.

<b>A CU 013 Internal error: 10, 000010, NOT_ALL_INPUT_DATA_PROCESSED_AND_INCONSISTENT,</b>

Desperately need some help...

Thanks,

Salil.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,527

Ignore default data and try to populate all the data in variant configurations,

I already tested and it works

Regards,

Bhupendra Singh

8 REPLIES 8
Read only

Former Member
0 Likes
1,527

Hi salil,

1. Some consistency problem with the data.

2. To check,

use the SAME DATA

and MANUALLY ENTER

thru tcode

and try to create a new sales order.

3. It will give error at that time also.

regards,

amit m.

Read only

Former Member
0 Likes
1,527

The problem u r facing is because of data only.

u may use this data and create a sales order manually.u will get the same result, so watever u did is ok its only data problem.

Regards,

Umasankar

Read only

Former Member
0 Likes
1,527

Hi,

Check the OSS note 872680.

This shoudl resolve your issue if I am right.

Visit this

It solved the issue in that case.

Thank you.

Regards,

Karun M

Read only

Former Member
0 Likes
1,528

Ignore default data and try to populate all the data in variant configurations,

I already tested and it works

Regards,

Bhupendra Singh

Read only

0 Likes
1,527

Hey Bupendra,

its working!!!! Thanks...!!! now I am able to upload Variant Configurations data.

Thanks again..

Salil.

Read only

0 Likes
1,527

Hi Salil,

I have same problem. Sales order is being created but Variant config data is not uploaded.

Can you help me with your code. I am passing exactly the way BAPISDORDER_GETDETAILEDLIST returns.

Thanks in advance.

Seshagiri

Read only

0 Likes
1,527

Hi Salil... I'm trying to create a SO with BAPI_SALESORDER_CREATEFROMDAT2 with a configurable material but i'm having problems with that...if u can send me and example or something that will be useful to help me...

I have problems with:

order_cfgs_ref

order_cfgs_inst

order_cfgs_part_of

order_cfgs_value

I only carry

order_header_in

order_partners

SALESDOCUMENT

order_cfgs_ref

order_cfgs_inst

order_cfgs_part_of

order_cfgs_value

PLs help me!!!!

Thanks a lot!!!

Read only

0 Likes
1,527

Hi ,

I am facing the issue while uploading the Variant conifgurations data.Can any one help? The BAPI is not giving any errors but variant configs are not populating.

ord_part-PARTN_ROLE = 'AG'.

ord_part-PARTN_NUMB = 'A300'.

append ord_part.

ord_part-PARTN_ROLE = 'WE'.

ord_part-PARTN_NUMB = 'A300'.

append ord_part.

data temp type string.

temp = sy-uzeit.

ord_hdr-DOC_TYPE = 'TA'.

ord_hdr-SALES_ORG = 'A300'.

ord_hdr-DISTR_CHAN = 'A1'.

ord_hdr-DIVISION = 'A1'.

ord_hdr-REQ_DATE_H = sy-datum + 1.

ord_hdr-PURCH_NO_C = temp.

ord_hdr_x-UPDATEFLAG = 'I'.

ord_hdr_x-DOC_TYPE = 'X'.

ord_hdr_x-SALES_ORG = 'X'.

ord_hdr_x-DISTR_CHAN = 'X'.

ord_hdr_x-DIVISION = 'X'.

ord_hdr_x-PURCH_NO_C = 'X'.

data : itemno type POSNR_VA,

hlitem type UEPOS,

configid type CUX_CFG_ID ,

rootid type CU_INST_ID,

instid type CU_INST_ID ,

SCHED_LINE type ETENR.

itemno = '000010'.

hlitem = '000010'.

configid = '000010'.

rootid = '00000010'.

instid = '00000001'.

SCHED_LINE = '0001'.

loop at matdetails.

if matdetails-MATERIAL is not initial.

ord_cfg_ref-POSEX = itemno.

ord_cfg_ref-CONFIG_ID = configid .

ord_cfg_ref-ROOT_ID = rootid.

append ord_cfg_ref.

ord_itm-ITM_NUMBER = itemno.

ord_itm-MATERIAL = matdetails-MATERIAL.

ORD_ITM-PO_ITM_NO = ord_cfg_ref-POSEX.

ord_itm-ITEM_CATEG = 'TAN'.

ord_itm-TARGET_QTY = matdetails-totquan.

append ord_itm.

ord_itm_x-ITM_NUMBER = itemno.

ord_itm_x-UPDATEFLAG = 'I'.

ord_itm_x-MATERIAL = 'X'.

ord_itm_X-PO_ITM_NO = 'X'.

ord_itm_x-item_categ = 'X'.

ord_itm_x-target_qty = 'X'.

append ord_itm_x.

ord_sch-ITM_NUMBER = itemno.

ord_sch-REQ_DATE = matdetails-deldate.

ord_sch-REQ_QTY = matdetails-TOTQUAN.

ord_sch-SCHED_LINE = SCHED_LINE.

ord_sch-SCHED_TYPE = 'CP'.

append ord_sch.

ord_sch_x-ITM_NUMBER = itemno.

ord_sch_x-UPDATEFLAG = 'I'.

ord_sch_x-REQ_DATE = 'X'.

ord_sch_x-REQ_QTY = 'X'.

ord_sch_x-SCHED_LINE = SCHED_LINE.

ord_sch_x-sched_type = 'X'.

append ord_sch_x.

ORDER_CFGS_INST-CONFIG_ID = configid.

ORDER_CFGS_INST-INST_ID = instid.

ORDER_CFGS_INST-OBJ_TYPE = 'MARA'.

ORDER_CFGS_INST-CLASS_TYPE = '300'.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

INPUT = matdetails-material

IMPORTING

OUTPUT = matdetails-material.

endif.

if matdetails-SQUAN > 0.

  • instid = instid + 1.

write instid to instid.

ORDER_CFGS_INST-CONFIG_ID = configid.

ORDER_CFGS_INST-INST_ID = instid.

ORDER_CFGS_INST-OBJ_TYPE = 'MARA'.

ORDER_CFGS_INST-CLASS_TYPE = '300'.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

INPUT = matdetails-material

IMPORTING

OUTPUT = matdetails-material.

ORDER_CFGS_INST-OBJ_KEY = matdetails-material.

ORDER_CFGS_INST-QUANTITY = matdetails-SQUAN.

ORDER_CFGS_INST-QUANTITY_UNIT = matdetails-VRKME.

append ORDER_CFGS_INST.

ORDER_CFGS_VALUE-CONFIG_ID = configid.

ORDER_CFGS_VALUE-INST_ID = instid.

CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'

EXPORTING

INPUT = charval

IMPORTING

OUTPUT = charval.

*

ORDER_CFGS_VALUE-CHARC = charval.

ORDER_CFGS_VALUE-VALUE = 'S'.

CALL FUNCTION 'CONVERSION_EXIT_SIZE_INPUT'

EXPORTING

INPUT = ORDER_CFGS_VALUE-VALUE

IMPORTING

OUTPUT = ORDER_CFGS_VALUE-VALUE.

append ORDER_CFGS_VALUE.

endif.

if matdetails-MQUAN > 0.

instid = instid + 1.

write instid to instid.

ORDER_CFGS_INST-CONFIG_ID = configid.

ORDER_CFGS_INST-INST_ID = instid.

ORDER_CFGS_INST-OBJ_TYPE = 'MARA'.

ORDER_CFGS_INST-CLASS_TYPE = '300'.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

INPUT = matdetails-material

IMPORTING

OUTPUT = matdetails-material.

ORDER_CFGS_INST-OBJ_KEY = matdetails-material.

ORDER_CFGS_INST-QUANTITY = matdetails-SQUAN.

ORDER_CFGS_INST-QUANTITY_UNIT = matdetails-VRKME.

append ORDER_CFGS_INST.

ORDER_CFGS_VALUE-CONFIG_ID = configid.

ORDER_CFGS_VALUE-INST_ID = instid.

CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'

EXPORTING

INPUT = charval

IMPORTING

OUTPUT = charval.

*

ORDER_CFGS_VALUE-CHARC = charval.

ORDER_CFGS_VALUE-VALUE = 'M'.

CALL FUNCTION 'CONVERSION_EXIT_SIZE_INPUT'

EXPORTING

INPUT = ORDER_CFGS_VALUE-VALUE

IMPORTING

OUTPUT = ORDER_CFGS_VALUE-VALUE.

append ORDER_CFGS_VALUE.

endif.

itemno = itemno + 10.

configid = configid + 1.

instid = instid + 1.

sched_line = sched_line + 1.

endloop.

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

ORDER_HEADER_IN = ord_hdr

ORDER_HEADER_INX = ord_hdr_x

IMPORTING

SALESDOCUMENT = sonum

TABLES

RETURN = ret

ORDER_ITEMS_IN = ord_itm

ORDER_ITEMS_INX = ord_itm_x

ORDER_PARTNERS = ord_part

ORDER_SCHEDULES_IN = ord_sch

ORDER_SCHEDULES_INX = ord_sch_x

ORDER_CFGS_REF = ord_cfg_ref

ORDER_CFGS_INST = order_cfgs_inst

ORDER_CFGS_VALUE = order_cfgs_value

  • ORDER_CFGS_PART_OF = ORDER_CFGS_PART_OF

  • * ORDER_CFGS_REFINST = ORDER_CFGS_REFINST

.