cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI to upload safety days of supply to Product Master

Former Member
0 Kudos

Hi experts,

I need to know the BAPI which can be used to fill the <b>safety days of supply</b> to Product Master. <b>BAPI_PRDSRVAPS_SAVEMULTI_30A</b> doesn't seem to update it. I'm passing the product information in the PRODUCT_HEAD, PRODUCT_HEAD_X and location information in the PRODUCT_LOCATION (fields - SAVETY_TIME, MSDP_SB_METHOD) & PRODUCT_LOCATION_X (same fields set to 'X') in addition to the product information.

The BAPI is now set as <b>obselete</b>.

Another BAPI I checked was <b>BAPI_PRDSRVAPS_SAVEMULTI2</b>. But couldn't figure out <b>the field for safety days of supply</b> in that.

Please let me know if we have any other BAPI for this.

Thanks,

Mallika.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mallika,

Go to the function module /SAPAPO/DM_PRODUCTS_POST and keep the break point at Line Number 270 ( ELSEIF iv_vb = 'U'.) and check what happens. At line number 367 they are updating the /sapapo/matlotsz table.

Regards,

Siva.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Mallika,

Which version of APO are u using?

I can able to find out the form under the include /SAPAPO/LDM_MATERIALF02.

Check this out and let me know .

Thanks,

Siva.

Former Member
0 Kudos

We don't have the perform in that include. And the structure /sapapo/dm_matloc_mass_ch_flds is also not available.

Component Version SCM 5.00.

The function module /SAPAPO/DM_PRODUCT_POST_ONE

I tested with an existing material passing the iv_vb parameter as 'U' - update and lszid and svtty fields in the is_matlotsz structure. Didn't update the safety day's of supply. Am I missing something ?

Former Member
0 Kudos

Hi Mallika,

Also try out this function module /SAPAPO/DM_PRODUCT_POST_ONE. This may work.

Regards,

Siva.

Former Member
0 Kudos

Hi Mallika,

This is an external subroutine.

So can find the form in the /sapapo/sapldm_material program.

Thanks,

Siva.

Former Member
0 Kudos

Hi Siva,

But I get dump while executing - Call (PERFORM) to a non-existent routine.

& the error analysis says The reason for the exception is:

The program is meant to execute an external PERFORM,

namely the routine "MATLOC_MASS_CHANGES_MATLOTSZ" of the program

"/SAPAPO/SAPLDM_MATERIAL", but

this routine does not exist.

"/SAPAPO/SAPLDM_MATERIAL" is currently being developed.

he name "MATLOC_MASS_CHANGES_MATLOTSZ" of the called routine may be incorrect,

or

the routine "MATLOC_MASS_CHANGES_MATLOTSZ" is not yet implemented in the

program "/SAPAPO/SAPLDM_MATERIAL".

-

Thanks,

mallika.

Former Member
0 Kudos

in the same BAPI_PRDSRVAPS_SAVEMULTI2

try table PRODUCT_LOCATION_VERSION, there is a field called safety days of supply

Former Member
0 Kudos

Hi Malika,

We had a similar situation to update to update the RDPRF field in the Product Master. Since we didn't get a BAPI to update it, took the logic from standard program. Pasted the code below. Change it according to ur requirement. Else you can do an direct update to the /SAPAPO/MATLOTSZ table by getting the LSZID from the /SAPAPO/MATLOC table.

Regards,

Siva.

<b>Sample Code:</b>

ABLES: z08od_material_1.

TYPES: BEGIN OF g_movedef_str_typ,

to_table LIKE dfies-tabname,

from_table LIKE dfies-tabname,

from_fld LIKE dfies-fieldname,

from_fld_txt LIKE dfies-scrtext_m,

from_fld_pos LIKE dfies-position, "position in from tab

to_fld_pos LIKE dfies-position, "position in to tab

from_pm_op_fld_pos LIKE dfies-position,

from_pm_par_fld_pos LIKE dfies-position,

from_md_op_fld_pos LIKE dfies-position,

from_md_par_fld_pos LIKE dfies-position,

from_avval_flg_pos LIKE dfies-position,

op_flg TYPE c, "operations are poss.

packed_time_flg TYPE c.

TYPES: END OF g_movedef_str_typ.

TYPES: g_movedef_tab_typ TYPE g_movedef_str_typ OCCURS 0.

DATA: i_lotsz_tab TYPE /sapapo/matlotsz OCCURS 0.

DATA: i_lotszkey_tab TYPE /sapapo/s_lotszkey OCCURS 0.

DATA: wa_lotsz TYPE /sapapo/matlotsz.

DATA: wa_lotszkey TYPE /sapapo/s_lotszkey.

DATA: i_move_tab TYPE g_movedef_tab_typ.

DATA: wa_move_tab TYPE g_movedef_str_typ.

DATA: i_mass_change_sel_tab LIKE /sapapo/mass_ch OCCURS 0.

DATA: wa_mass_change_sel_tab LIKE /sapapo/mass_ch.

DATA: i_entered_fields_str

TYPE /sapapo/dm_matloc_mass_ch_flds.

DATA: c_matloc_str TYPE /sapapo/matloc.

SELECT-OPTIONS : s_locno FOR z08od_material_1-locno

NO INTERVALS NO-EXTENSION

OBLIGATORY.

SELECT-OPTIONS : s_matnr FOR z08od_material_1-matnr.

PARAMETER: n_rdprf LIKE /sapapo/matlotsz-rdprf.

SELECT * FROM z08od_material_1 WHERE locno IN s_locno

AND matnr IN s_matnr.

SELECT SINGLE * FROM /sapapo/matlotsz

INTO CORRESPONDING FIELDS OF wa_lotsz

WHERE lszid = z08od_material_1-lszid.

APPEND wa_lotsz TO i_lotsz_tab.

wa_lotsz-rdprf = n_rdprf.

APPEND wa_lotsz TO i_lotsz_tab.

wa_lotszkey-lszid = z08od_material_1-lszid.

wa_lotszkey-updatef = 'N'.

APPEND wa_lotszkey TO i_lotszkey_tab.

MOVE-CORRESPONDING z08od_material_1 TO c_matloc_str.

ENDSELECT.

wa_move_tab-to_table = '/SAPAPO/MATLOTSZ'.

wa_move_tab-from_table = '/SAPAPO/DM_MATLOC_MASS_CH_FLDS'.

wa_move_tab-from_fld = 'RDPRF'.

wa_move_tab-from_fld_txt = 'RundProfil'.

wa_move_tab-from_fld_pos = '0056'.

wa_move_tab-to_fld_pos = '0012'.

APPEND wa_move_tab TO i_move_tab.

wa_mass_change_sel_tab-mass_ch_app = 'ML'.

wa_mass_change_sel_tab-element = '12'.

wa_mass_change_sel_tab-counter = '1'.

wa_mass_change_sel_tab-input_str = '/SAPAPO/DM_MATLOC_MASS_CH_FLDS'.

wa_mass_change_sel_tab-input_fld = 'RDPRF'.

wa_mass_change_sel_tab-dest_tab = '/SAPAPO/MATLOTSZ'.

wa_mass_change_sel_tab-dest_fld = 'RDPRF'.

wa_mass_change_sel_tab-simple_move_flg = 'X'.

wa_mass_change_sel_tab-screen_group = '13'.

APPEND wa_mass_change_sel_tab TO i_mass_change_sel_tab.

PERFORM matloc_mass_changes_matlotsz(/sapapo/sapldm_material)

TABLES

i_move_tab

i_mass_change_sel_tab

i_lotsz_tab

i_lotszkey_tab

USING

i_entered_fields_str

CHANGING

c_matloc_str.

COMMIT WORK.

Former Member
0 Kudos

Thank you for your inputs. What are the changes in the <b>PERFORM matloc_mass_changes_matlotsz(/sapapo/sapldm_material)</b>

Can you send in the form code.

Thanks,

mallika.

Message was edited by:

Mallika Haridas

Message was edited by:

Mallika Haridas

Former Member
0 Kudos

Thank you for your inputs.

mallika.

Message was edited by:

Mallika Haridas