cancel
Showing results for 
Search instead for 
Did you mean: 

Help on BADI /SAPAPO/SDP_RELDATA

Former Member
0 Kudos

Hi Experts,

We are using /SAPAPO/SDP_RELDATA while releasing from DP to SNP.

We would like to use the following methods for indicated purposes:

CHANGE_RELDATA - release forecast on the second week from the system date.

Please help me, how to modify the internal tables CT_COLS and CT_TAB in the method CHANGE_RELDATA..

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Guys,

Ive got the same kind of problem where planners want to see the data for the first 3 months in weeks and the rest in months. I have been following these threads and found that i should use the badi /SAPAPO/SDP_RELDATA but im confused on how to change the values of the internal tables CT_TAB and CT_COLS so that i can acheive this functionality. Any body who has faced the similar kind of problem can you please help me out.

Thanks.

venkat

Former Member
0 Kudos

Hi,

I got the answer.

We need not to use BADI/FM.

Just follow these steps:

Hi,

Copy Data view:

1. Go to transaction /n/sapapo/sdp8b. enter your planning book and enter the new dataview name

2. Check the icon "With Ref." and enter your existing view that you want to copy.

3. Click on create and the whole view is copied over.

4. In data view tab, enter your TB profiles for future and enter 2 in the offset box.

5. When you activate the view, it should start from 2 weeks from today.

Infact I got this from SDN only. It was posted by Visu Venkat.

Thanks to Visu..

Thanks to SDN

Former Member
0 Kudos

Hello Venkatesh,

See the below code it may give you an Idea.

  • read the source forecast date

READ TABLE ct_cols INTO ls_temp INDEX 1.

IF sy-subrc = 0.

CLEAR lv_dat_tim.

lv_dat_tim = ls_temp-tstfr.

ls_z08ol_fore_det-fore_from = lv_dat_tim+0(6).

ENDIF.

  • read the destination forecast date

CLEAR lv_dat_tim.

READ TABLE ct_cols INTO ls_temp INDEX 12.

IF sy-subrc = 0.

lv_dat_tim = ls_temp-tstto.

ls_z08ol_fore_det-fore_to = lv_dat_tim+0(6).

ELSE.

READ TABLE ct_cols INTO ls_temp INDEX 11.

lv_dat_tim = ls_temp-tstto.

ls_z08ol_fore_det-fore_to = lv_dat_tim+0(6).

lv_mon_chk = 'X'.

ENDIF.

I think you want to change these 2 records right?...

Quantities fro 12 month will be stored as follows..

LOOP AT ct_cols INTO ls_temp.

LOOP AT ct_tab INTO xtabline WHERE c = ls_temp-column.

IF ls_temp-column = 1. " quantity for first month

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty1 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty2 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 2. " quantity for secon month and so on

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty2 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty3 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 3.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty3 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty4 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 4.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty4 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty5 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 5.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty5 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty6 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 6.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty6 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty7 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 7.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty7 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty8 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 8.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty8 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty9 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 9.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty9 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty10 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 10.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty10 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty11 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 11.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty11 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty12 = xtabline-v.

ENDIF.

EXIT.

ENDIF.

IF ls_temp-column = 12.

IF lv_mon_chk = space.

ls_z08ol_fore_det-qty12 = xtabline-v.

ELSE.

ls_z08ol_fore_det-qty1 = 0.

ENDIF.

EXIT.

ENDIF.

ENDLOOP.

ENDLOOP.

I hope this will help you...

Let me know if have any doubt..

Best regards,

Srini

Former Member
0 Kudos

Are you using the BADI just to influence the date??

There is a way to do this release functionally without using code but i suppose you want the development done

srinivas_krishnamoorthy
Active Contributor
0 Kudos

Why do you need a BADI to release forecast starting two weeks out from system date ? You can configure you variant to use the start date as a dynamic date in the variant, 2 weeks out of system date. the variable P_DATFR can be set to a dynamic date using the option of Current Date+14 days.

If you are forced to use BADI, use the code below

__________________________________________________

declaration

data: v_day type SCAL-INDICATOR

v_date type sy-datum,

if sy-subrc eq 0.

CALL FUNCTION 'DATE_COMPUTE_DAY'

EXPORTING

DATE = v_date.

Check if v_date < 14 + sy-date and clear out the forecasts.

Former Member
0 Kudos

Hi Somnath,

Thank you very much for the quick response.

I am desperately waiting for someone’s response to my mail.

I am totally new to CT_COLS and CT_TAB concept.

Can you help me in detail, how to handle my requirement?

Regards,

Venkat

somnath_manna
Active Contributor
0 Kudos

CT_COLS will be the columns of the data view containing the Time Stamps from and to for each time bucket.

CT_TAB will most likely be the keyfigure data value (V) per cell of the data view (intersection of row Z and column C).

Somnath

somnath_manna
Active Contributor
0 Kudos

I assume you are from the Technical (read App Dev) team.

If so please check with your functional analyst to take you through the process of release from DP to SNP. They would be using a Planning Book / Data View for the release. Once you see the Interactive SDP screens and the process it will be quite clear.

In that case the columns of the Data View will be CT_COLS.

CT_TAB will be the data you see in the Interactive Planning Table.

Oh! and check with your functional consultant if they really want an enhancement or they can use standard functionality as suggested by the other esteemed gurus. Harish / Srinivas you have earned the much acclaimed titles of "Gurus" :). I am sure some other regulars like Ian, Anjali have also earned the title. Maybe we should have a Wiki page for the Gurus and link to their profile - any thoughts. Sorry for the rant - please bear with me as I am struggling with 3/4 enhancements (out of the 28 in current release).

Somnath