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

Query on BAPI_ROUTING_CREATE

Former Member
0 Likes
1,555

Hi All,

I am using BAPI_ROUTING_CREATE to create routings. My requirement is that while creating a routing if user chooses reference, I donot want to increment the Group counter (PLNAL) - only one of the fields ZKRIZ(Counter for additional criteria) or ZAEHL (Internal counter) should get incremented.

While passing parameter TASK and MATERIAL task allocation i tried to keep the PLNAL same. But, the BAPI returns an error saying :-

"Task list N 50000001 7 already exists"

where, 50000001 = PLNNR (Key for Task List Group) AND

7 = PLNAL (Group Counter)

How do i keep the PLNAL same incrementing only the ZKRIZ / ZAEHL field ?

Regards,

Ashish

6 REPLIES 6
Read only

Former Member
0 Likes
1,133

Ashish,

It looks like the BAPI_ROUTING_CREATE considers each record as a new task list for the routing, basically it looks like it is intended for creation rather than modification which is your requirement.

Now if I see your requirement, I think if you want to go by the Bapi way, you should create a custom BAPI which based on user selection creates routing using BAPI_ROUTING_CREATE or modifies routing

based on custom code which you would implement. The modification part can be implemented as

a call transaction.

Or you can implement the whole functionality as a call transaction inside a BAPI or FM.

Sojan

Read only

0 Likes
1,133

Hi Sojan / Ankesh,

Thanks for the reply

But, somehow it is not clear how to proceed. Could you please elaborate more on how do I go about it?

@Sojan, how do I use call transaction to modify the routing ?

@Ankesh, can you please tell me exactly which BDC I need to change ?

Any suggestions would be of great help !!!!

Regards,

Ashish

Read only

0 Likes
1,133

Hi Ashish,

Before moving any further, have you tried achieving the same by manually modifying the Group?

How it has to be achieved manually in the case a reference is made?

Please revert with this.

The standard program for Creating Routings is RCPTRA01 which uses Batch input. But modifying it can also be understood once the same is achieved manually.

Read only

0 Likes
1,133

Hi Ankesh,

I have tried it manually through transaction CEWB i.e. for a Routing if we go to the material data and assign the same material more than once it creates multiple entries in table MAPL (keeping the group counter same) and incrementing only the ZKRIZ field.

Regards,

Ashish

Read only

Former Member
0 Likes
1,133

HI Ashish,

As Sojan has also indicated BAPI_ROUTING_CREATE will try to create a Group Number.

As running a bdc could also be tricky. You could try one more thing. The default program for Creating Routings also uses bdc and not direct input. You can copy it into a Z-program to customise it.

First of all try to have a recording. But do keep in mind that from the first screen of CA02 different screens may open up as second screen depending whether there are any Material allocations or not.

Revert if there is anything to further look up.

Read only

Former Member
0 Likes
1,133

Ashish,

Call transaction is an abap statement used inside an ABAP program (BAPI/FM/REPORT/Dialogue programming) to call a standard transaction in SAP and execute the sequence of screens automatically with the program feed, synchronously.

You would find several sample programs over the net to accomplish this functionality,

http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9da935c111d1829f0000e829fbfe/content.htm

Sojan