cancel
Showing results for 
Search instead for 
Did you mean: 

Start routine in Transfer rule

Former Member
0 Kudos

Hi All,

I need a sample code of how to write simple code in start routine. I need to do some manipulation on the data available in DATAPAK in transfer routine. Like simple loop at datapak where xyz = 'x'.

and doine some kind of manipulation. on the data.

Thanks in advance. I will award points for sure

Cheers

PB

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Here is some sample code ..

  • abort <> 0 means skip whole data package !!!

*Populating MVGR1 based on Material.

loop at DATAPAK into WA_DATAPAK.

zlen = strlen( WA_DATAPAK-matnr ).

if zlen gt 2.

zlen = zlen - 2.

zstr = WA_DATAPAK-matnr+zlen(2).

case zstr.

when '.A'.

I_MVGR1-ZMVGR1 = 'A'.

when '.B'.

I_MVGR1-ZMVGR1 = 'B'.

when '.C'.

I_MVGR1-ZMVGR1 = 'C'.

when '.R'.

I_MVGR1-ZMVGR1 = 'R'.

when others.

I_MVGR1-ZMVGR1 = WA_DATAPAK-S_MVGR1.

endcase.

endif.

I_MVGR1-ZMATNR = WA_DATAPAK-MATNR.

append I_MVGR1.

clear I_MVGR1.

endloop.

sort I_MVGR1 by zmatnr zmvgr1.

ABORT = 0.

$$ end of routine - insert your code only before this line -

ENDFORM.

you can read I_MVGR1 in your transfer structure routine and papulate the field , it is efficient ...

Ravi

Former Member
0 Kudos

dear u have to write the code for ur requirement in the start routine.

whatever object for which u need to do filtering is brought in internal table and that internal table is then used in transfer routines.

code will depend on exact requirement.

take the help of ABAPer for this.

Former Member
0 Kudos

Sun,

I am looking for a sample code.

Cheers

Former Member
0 Kudos

Hi PB;

Check this out.

-


loop at DATA_PACKAGE .

IF DATA_PACKAGE-/BIC/ZDELIND = 'X'.

DELETE DATA_PACKAGE.

ELSE.

ENDIF.

endloop.

-


Hope this helps.

Buddhi R.