cancel
Showing results for 
Search instead for 
Did you mean: 

Update APO field TARGET_DUR by CIF interface

0 Kudos

Hello,

We would like to force APO Target Days' Supply by CIF with a constant.

Field to be displayed in /SAPAPO/MAT1 > Lot Size > Quantity and Date Determination.

Technical name = TARGET_DUR

Some fields are already forced using APO's BADI SMOD_APOCF005.

For example we force the  Safety Stock Method with a constant and it works very well.

(field MSDP_SP_METHOD)

In debug mode, it_matloc and  it_matlocx are well filled with our Safety days' supply constant.

But in the end, the value visible in /SAPAPO/MAT1 is still empty. It seems that CIF interface calculate or map this field again, after BADI SMOD_APOCF005.

Do you have any other idea to update Safety Days' Supply by CIF ?

Is there a BADI or an user exit more powerfull than SMOD_APOCF005 ?

Thank you !

----------------

Here is the code used (which works fine for field MSDP_SP_METHOD)

       ls_cif_matloc-msdp_sb_method = 'BT'.

       ls_cif_matloc-target_dur = 20.

        MODIFY it_matloc FROM ls_cif_matloc.

       READ TABLE it_matlocx

            INTO ls_matlocx WITH KEY ext_matnr = ls_cif_matloc-ext_matnr

                                     ext_locno = ls_cif_matloc-ext_locno.

       IF sy-subrc = 0.

         lv_tabix = sy-tabix.

         ls_matlocx-msdp_sb_method = 'X'

         ls_matlocx-target_dur = 'X'.

         MODIFY it_matlocx FROM ls_matlocx INDEX lv_tabix.

       ENDIF.

Accepted Solutions (1)

Accepted Solutions (1)

marianoc
Active Contributor
0 Kudos

Hi Remy,

I couple of weeks ago I load a document with an example of how to automate MAT1 fields when the materials are CIFfed. Please take a look of the document, I have detail the code:

http://scn.sap.com/docs/DOC-56755

In my code, the dafaults are entered in a custom table: ZAPOSETUP. You can modify this based on your needs.

I checked and the field TARGET_DUR is available to be automated. You will need to add something like:

                    WA_IT_MATLOC-TARGET_DUR = 'your default'.
                    WA_IT_MATLOCX-TARGET_DUR = 'X'.

Kind Regards,

Mariano

0 Kudos

Thanks for your answer, but we already wrote this code, which is very similar to yours. Don't you agree ?

DATA :

ls_cif_matloc     TYPE  /sapapo/cif_matloc,

ls_matlocx    TYPE /sapapo/cif_matlocx,

ls_cif_matloc-target_dur = 20.

ls_matlocx-target_dur = 'X'.

marianoc
Active Contributor
0 Kudos

Hi Remy,

Yes it is pretty similar. I remember than when I was trying to default the GR Processing time, I noticed that the number to be enter needed a different format. For example instead setting as defaul GRPRT = 1, I had to enter GRPRT = 240000 (which is 1 day). Try to do the same...

If this does not help, I would debbug the CIF:

1- Go to SMQ2 in APO and ensure there are no entries (queues)

2- Go to SMQR in order to deregister the CIF in APO side

3- Run CMF1 and CMF2 in ECC for you material

4- Go to SMQ2 in APO. You will see a new entry. This is your queue that was stucked in the CIF because you have deregistered the CIF. You can debbug the queue.

5- Do not forget to make the Registration again in SMQR.

Thanks and Regards,

Mariano

0 Kudos

Well done Mariano, it is the correct answer : the system expects a value in this format :

1 day = 240000

So for a 20 days constant we have to put

s_cif_matloc-target_dur = 4800000.


Thanks a lot,



Rémy




Answers (0)