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

BAPI_SALESORDER_CREATEFROMDAT2 bapi is not populating the right item category when referencing contract items.

Former Member
0 Likes
3,111

Hi All,

Sales orders create BAPI (BAPI reference
BAPI_SALESORDER_CREATEFROMDAT2.) not populating the right item category
when referencing contract items.

We filled contract details in item structure ORDER_ITEMS_IN-REF_DOC (
Document number) ,ORDER_ITEMS_IN-REF_DOC_IT ( Contract item position)
and ORDER_ITEMS_IN-REF_DOC_CA ( Document category)
for creating order.

The sales order is getting created successfully with right reference of
contract # and item number, but item category is not reflecting
correctly.

It is picking general item category that is meant of standard sales
order against the item category defined for contract sales orders.

Many many thx for giving solution for this ,its very urgent need.


Thanks,
Nagireddy.

Hi All,

Sales orders create BAPI (BAPI reference
BAPI_SALESORDER_CREATEFROMDAT2.) not populating the right item category
when referencing contract items.

We filled contract details in item structure ORDER_ITEMS_IN-REF_DOC (
Document number) ,ORDER_ITEMS_IN-REF_DOC_IT ( Contract item position)
and ORDER_ITEMS_IN-REF_DOC_CA ( Document category)
for creating order.

The sales order is getting created successfully with right reference of
contract # and item number, but item category is not reflecting
correctly.

It is picking general item category that is meant of standard sales
order against the item category defined for contract sales orders.

Many many thx for giving solution for this ,its very urgent need.


Thanks,
Nagireddy.

12 REPLIES 12
Read only

ThangaPrakash
Active Contributor
0 Likes
2,250

Hello Nagiredddy,

Did you pass 'X' to the respective check box parameter table?

If not pass 'X' and check, it will work.

ORDER_ITEMS_INX-REF_DOC = 'X'.

ORDER_ITEMS_INX-REF_DOC_IT = 'X'.

ORDER_ITEMS_INX-REF_DOC_CA = 'X'.

Regards,

Tp

Read only

0 Likes
2,250

yes,I have passed all the above parameters,still item category is not picked correctly automatically,

its able to create order with refrence to contract refrence..problem is only item category is getting incorrect

Read only

Former Member
0 Likes
2,250

Very very needfull to me ,pls help on this .

Many many thx

Read only

0 Likes
2,250

Paste your code here, we will check it

Read only

0 Likes
2,250

Hi,

I am giving the structures and field names.

ORDER_HEADER_IN

        REFDOCTYPE
        DOC_TYPE                       ZOR
        COLLECT_NO
        SALES_ORG                      B227
        DISTR_CHAN                     BD
        DIVISION                       XX

ORDER_HEADER_INX

       UPDATEFLAG                     I
       DOC_TYPE                       X
       COLLECT_NO
       SALES_ORG                      X
       DISTR_CHAN                     X
       DIVISION                       X

ORDER_ITEMS_IN

           ITM_NUMBER                     000010
           MATERIAL                       7041931
           TARGET_QTY                                1.000

           REF_DOC                        143005977

           REF_DOC_IT                     000010

           REF_DOC_CA                     G

ORDER_ITEMS_INX

           ITM_NUMBER                     000010
           UPDATEFLAG                     I
           MATERIAL                          X
           PLANT                                X
           TARGET_QTY                     X

           REF_DOC                           X

           REF_DOC_IT                       X

           REF_DOC_CA                     X

ORDER_SCHEDULES_IN

           ITM_NUMBER                     000010
           SCHED_LINE                      0001
           REQ_QTY                           1.000

ORDER_SCHEDULES_INX

           ITM_NUMBER                     00001
           SCHED_LINE                     0001
           UPDATEFLAG                     X
           REQ_QTY                           X

this bapi we are connectiong from third party system..just they pass values mentione the above structes and field then need to create order in sap

Many thx,

Nagireddy

Read only

0 Likes
2,250

Hello Nagireddy,

1) Go to transaction VTAA and select the from and to order combination, click on item in the left.

2) The system will display the item categories, choose the item category which you wanted and click on details icon in the top.

3) You will find copying requirements, do a F4 on the field, you will find the routine numbers list, click on the routine and select the source code icon, it will display a ABAP code, check if there is any logic which is responsible for your scenario.

Regards,

Tp

Read only

ThangaPrakash
Active Contributor
0 Likes
2,250

Hello Nagireddy,

Did you check on the above points?

Regards,

TP

Read only

0 Likes
2,250

Hi Prakesh,

thanks lot  for keep on helping to me.

yes ,I have check the logic in the routnes.

I amattacheing the document which is analyside the issue.

As per configuration item category need to come ‘ZBBX’, below is the configuration screen shot.

I created order 3551826 through VA01 manually with reference to contract

Item category determined as “ ZBBX “,contract levelized usage 0144002618 / 50.

I created order 3551843 through Bapi with reference to contract here is category

Determined as “ZONC “, contract levelized usage 0144002618 / 50.

Thanks,

Nagireddy.

Read only

0 Likes
2,250

Hi,

I am not able to send the attachement ,can you please send the your gmail id.

Thanks,

Nagireddy

Read only

0 Likes
2,250

Hi,

Paste your copy control routine code here.

Regards,

Tp

Read only

0 Likes
2,250

yes,

in copy control routine no code is available regarding item category issue.

Thanks,

Nagireddy.

Read only

0 Likes
2,250

Hello,

Write a code inside the routine for determination of the item category.

Regards,

Tp