cancel
Showing results for 
Search instead for 
Did you mean: 

Mass material assignment in Inspection Plan.

Former Member
0 Kudos

Hi Friends,

We are having requirement of assigning 20000 materials to single Inspection Plan ( since same characteristics need to be checked for each material). I have initially made Inspection plan with out assigning any material, now to the group already created i want to assign 20000 materials (using T code QP02).

My problem is assigning of these 20 k materials to a single group. Manually at a time only 14 materials cab be assigned, tried to make LSMW but the process is very slow as you need to do page down many times (20000/ 14).

Can anybody suggest the faster way of assigning these materials?

Thanks and Regards,

Shekhar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I have gone th' the similar requirement earlier & I used a BDC program to assign the materials in inspection plan.

Record the transaction in SHD0, provide sample master data to ABAP consultant & then develop a BDC.

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Just an addition to the thread.


I got the exact requirement recently where user uploads an excel as input and we have to update Material assignments to Inspection plants for all combinations present in the excel sheet.

There is a 'Not Released' FM "CPCC_S_TASK_LIST_MAINTAIN" which can be used to achieve the requirement. I understand if some people would want to refrain from using this as the FM is not released but I think it's still better than BDC approach.

Regards,

Sheel

beyhan_meyrali
Active Contributor

Works just great! Thanks for the tip!

Here is the full code for you all.

  METHOD add_material_to_plan.

    DATA: exref TYPE REF TO cx_root.
    TRY.
        DATA: material_task_allocations	  TYPE TABLE OF	cps_task_list_maint_mtk.

        APPEND VALUE #( maintain_mode = 'C' material = rec-matnr plant = rec-werks )
        TO material_task_allocations.

        CALL FUNCTION 'CPCC_S_TASK_LIST_MAINTAIN'
          EXPORTING
            key_date                    = sy-datum
            task_list_type              = 'Q'
            task_list_group             = rec-plnnr
            group_counter               = rec-plnal
            plant                       = rec-werks
            task_maintain_mode          = 'M'
          TABLES
            material_task_allocations   = material_task_allocations
            return                      = return.

        DATA(stat) = zutils_cl_gu=>bapiret_to_status( bapiret = return ).
        IF stat-status EQ zutils_cl_defs=>c_stat_success.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        ENDIF.

        rec-status = stat-status.
        rec-status_text = stat-status_text.

      CATCH cx_root INTO exref.
        rec-status = zutils_cl_defs=>c_stat_error.
        rec-status_text = exref->get_text( ).
    ENDTRY.
  ENDMETHOD.
marc-werner
Explorer
0 Kudos

beyhan.meyrali : thanks for sharing the code. Unfortunately I have not really an idea how to implement it. Perhaps you can share more Information how to do this.

thanks in advance

Marc

beyhan_meyrali
Active Contributor
0 Kudos

Hi Marc,

That is the whole code you need. That does not get any simpler than that.

Just show that code and screen fields to an Abap developer and will do in a second.

Regards

Martin_H
Contributor
0 Kudos

Are you not using LSMW with object 0240? I would expect that you do not have these limits then.

Regards

Martin

lakshmi_prasad7
Contributor
0 Kudos

can u check the bapi basically i am using bapi for uploading quality plan

former_member662213
Contributor
0 Kudos

Hi,

You can try the LSMW for transaction CWBQM(Engineering Workbench) as this transaction is generally used for mass changes/uploading.

In the CWBQM, there is a push button for "Insert row"(Ctrl+f4) also while assigning material to the task list.

Thanks

SUMIT GUPTA

Former Member
0 Kudos

Thanks Sumit, I found your advice very helpful. After trying in several ways this one was the one that finally worked for me.

former_member591502
Discoverer
0 Kudos

Hi

When creating the LSMW, on the Assignment screen, do a Last PAge (ShiftF12) and Next Page (ShiftF11). Enter your new value in second line (maybe do originally first line manually). This way recording will always go to second line of last page and your data will be read 1 entry at a time.

LSMW is then much easier, as well as setting up data.

Corne

Former Member
0 Kudos

Thanks Corne, nice tip for this or any other similar transaction.

Former Member
0 Kudos

Remember one thing that appending SQL or database is harmful which during batch run may delete or append wrong data.

Best way is o create BDC with some code from SHDB

Former Member
0 Kudos

Dear Friends,

Any better solution ? assigning 20000 materials manually 14 every times seem to be difficult task. My ABAPER is trying to develop the BDC but finding it difficult.

Best Regards,

Shekhar

former_member42743
Active Contributor
0 Kudos

For such large load i would ask for special premission to update table MAPL directly via an SQL append. The table structure is very simple and there aren't that many fields.

Most companies don't allow this, but for such a large load, you might be able to justify it.

FF

former_member42743
Active Contributor
0 Kudos

Sujit is very correct in what he says. I very rarely ever recommend a table update such as above. I only do so here because the table is a relatively simple table, there are no internal counters involved and your load is very large. You must make sure your data is VERY, VERY clean and with no typos or mistakes.

FF

Former Member
0 Kudos

HI,

I also came acrros with a similar situation, I developed a BDC with page down entry since this will assign the details in the inspection plan.

Further if you are using a LSMW, give a try to pass the record to 14 or 15 item. This might work because I did something similar long time back for routing material assignment.

Thanks & Best Regards

Charith

Martin_H
Contributor
0 Kudos

We are using an own developed ABAP program for this, so this is definitely also an alternative.

Regards

Martin

former_member587434
Active Contributor
0 Kudos

There is no other way for mass material assignment to inspection plan. You can assign 14 materials at a time & you need to do page down for next 14 materials.

Thanks!!!