Skip to Content
0
Former Member
Jul 29, 2007 at 07:01 AM

Problem in debug ?

14 Views

Hi,

I write the logic for my requirement for moving the posting date.

Logic is :

CASE I_ERKRS.

WHEN 'M200'.

MOVE-CORRESPONDING I_ITEM to CE0_M200.

IF NOT CE0_M200-fkart is initial.

IF NOT CE0_M200-FKART eq r_fkart.

CE0_M200-WWRPT = CE0_M200-BUDAT.

ElseiF CE0_M200-FKART eq r_fkart.

SELECT VBELn FROM VBFA into table i_vbeln

where vbelv = CE0_M200-kaufn

and VBTYP_V eq 'M'.

if sy-subrc = 0.

Describe table i_vbeln lines ws_lines .

If ws_lines = 1 .

Read table i_vbeln into wa_vbeln index 1 .

select single budat into ws_budat

from bkpf where awtyp = 'VBRK'

and awkey = wa_vbeln-vbeln.

CE0_M200-WWRPT = ws_budat .

Elseif ws_lines >= 1.

loop at i_vbeln into wa_vbeln.

select single matnr from vbrp into ws_c_matnr

where vbeln = wa_vbeln-vbeln

and matnr = CE0_M200-artnr.

if sy-subrc = 0.

select single budat into ws_budat

from bkpf

where awtyp = 'VBRK'

and awkey = wa_vbeln-vbeln.

CE0_M200-WWRPT = ws_budat .

exit.

ENDIF.

endloop.

ENDIF.

ENDIF.

ENDIF.

endif.

move-corresponding CE0_M200 to E_item.

ENDCASE.

First part is working fine.Means

IF NOT CE0_M200-fkart is initial.

IF NOT CE0_M200-FKART eq r_fkart.

CE0_M200-WWRPT = CE0_M200-BUDAT.

<b>When cursor comes to Elseif part</b>

ElseiF CE0_M200-FKART eq r_fkart.

it does not check any other conditions,directly cursor go to the move-corresponding CE0_M200 to E_item step.

What happend?Is there any wrong in my logic?Please give me ur suggestions?

Thanks & Regards,

sudhakar