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

Processing material movement using parallel processing - need help for split targets!

former_member282589
Participant
0 Likes
1,656

Hello.

Currently I'm planning a process for material movement, which are happens every month.

It looks like this :

You have different number of materials(in this screenshot, it's just 2 - but it can be more than 10+) to Good Issue(261), and I'm currently split them 300 lines, and creating document every 300 lines (for speed issue).

Problem is, Is it possible to make internal table dynamically, using other itab data?

In screenshot - I have to make 2 itab dynamically(using left itab - Material Num. to right table).

Any help would be appreciated. Thanks!

4 REPLIES 4
Read only

Gourab_Dey
Product and Topic Expert
Product and Topic Expert
0 Likes
1,546

Hi parkchanseul,

What you mean by dynamic table. Do you want to add one table data to other table, or you want to create a dynamic line type for internal table.

Thanks,

Gourab

Read only

former_member282589
Participant
0 Likes
1,546

Hi Gourab Dey,

I want to add another internal table for EACH row of Material Num. table.

For example )

I have 3 materials(A,B,C)

I have to make internal table for each row(gt_A, gt_B, gt_C).

Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
0 Likes
1,546

Hello parkchanseul

I think you don't really need to create internal tables dynamically. I'd suggest nested internal tables instead. For instance:

TYPES:
BEGIN OF t_record,
matnr TYPE matnr,
items TYPE bapi2017_gm_item_create_t,
END OF t_record,
t_table TYPE STANDARD TABLE OF t_record.

An internal table of t_table type contains records with two fields:

  1. MATNR - material number
  2. ITEMS - that's a nested table of BAPI2017_GM_ITEM_CREATE records.

This way you can create as many records as you need in the table and each record will hold a nested internal table similar to GT_A and GT_B in your question.

Of course you can define the type as you need - that's is just an example to explain the concept.

Best regards

Dominik Tylczynski

Read only

0 Likes
1,546

As I wrote - I 'copuled' 300 documents to 1 GI Document(like, 4911111111 - Item no 10 ~ 3000).

So, When I finished a parallel job - It updates a itab for ( Transaction Count / 300 ) + 1 (if have any leftover) Rows.

I can use your suggestion if i put all the transaction counts for 1 document, i.e putting 12000 line items into 1 document, sadly it's really time consuming - I think SAP BAPI for small line item use, but it's different kind of problem.

And.. I was worrying about.. 'modifying both itab at the same time' problem.

If parallel jobs finished at the same time, and it tries update t_table - Which DML will be used first?
I think Modify, or Update DML will put sy-subrc = 4, which are error - the table is locked.
So, I want to split the itab for job-basis. I think it completely negates the 'update' problem.