‎2007 Dec 04 8:43 AM
Hi All,
Please let me know is there anything wrong with following if statement.
LOOP AT t_bsid_zpp_zpr.
IF t_bsid_zpp_zpr-zterm = 'ZPP '.
IF ( t_bsid_zpp_zpr-blart = 'SS' OR t_bsid_zpp_zpr-blart = 'SR' ).
t_bsid = t_bsid_zpp_zpr.
APPEND t_bsid.
ENDIF.
ENDIF.
ENDLOOP.
IF NOT t_bsid[] IS INITIAL.
record-blart_002 = 'P7'.
PERFORM sub_process_records.
ENDIF.
Regards,
Sai Prasad
‎2007 Dec 04 8:50 AM
Hi,
nothing but if u r facing any problem on that then try like this
LOOP AT t_bsid_zpp_zpr.
IF ( t_bsid_zpp_zpr-zterm = 'ZPP ' ) AND
( t_bsid_zpp_zpr-blart = 'SS' ) OR
( t_bsid_zpp_zpr-blart = 'SR' ).
t_bsid = t_bsid_zpp_zpr.
APPEND t_bsid.
ENDIF.
ENDLOOP.
IF NOT t_bsid[] IS INITIAL.
record-blart_002 = 'P7'.
PERFORM sub_process_records.
ENDIF.
Regards,
Prashant
‎2007 Dec 04 8:50 AM
Hi,
nothing but if u r facing any problem on that then try like this
LOOP AT t_bsid_zpp_zpr.
IF ( t_bsid_zpp_zpr-zterm = 'ZPP ' ) AND
( t_bsid_zpp_zpr-blart = 'SS' ) OR
( t_bsid_zpp_zpr-blart = 'SR' ).
t_bsid = t_bsid_zpp_zpr.
APPEND t_bsid.
ENDIF.
ENDLOOP.
IF NOT t_bsid[] IS INITIAL.
record-blart_002 = 'P7'.
PERFORM sub_process_records.
ENDIF.
Regards,
Prashant
‎2007 Dec 04 8:53 AM
"Please let me know is there anything wrong with following if statement."
syntactically it is ok, the question is if you get, what you expect...
however you can make simplier:
LOOP AT t_bsid_zpp_zpr WHERE zterm = 'ZPP ' AND
( blart = 'SS' OR blart = 'SR' ).
t_bsid = t_bsid_zpp_zpr.
APPEND t_bsid.
ENDLOOP.
ec
‎2007 Dec 04 8:54 AM
hi sai
this if statement is correct . if condition is true then loop is working other wise it's not work .
check ur itab fields its correct r not .
‎2007 Dec 04 8:57 AM
‎2007 Dec 04 9:03 AM
Absolutely correct. Maybe something's wrong in your form sub_process_records?
Regards,
John.
‎2007 Dec 04 9:08 AM
First, it isn't surrounded by CODE blocks, so I'll fix that.
LOOP AT t_bsid_zpp_zpr.
IF t_bsid_zpp_zpr-zterm = 'ZPP '.
IF ( t_bsid_zpp_zpr-blart = 'SS' OR t_bsid_zpp_zpr-blart = 'SR' ).
t_bsid = t_bsid_zpp_zpr.
APPEND t_bsid.
ENDIF.
ENDIF.
ENDLOOP.
IF NOT t_bsid[] IS INITIAL.
record-blart_002 = 'P7'.
PERFORM sub_process_records.
ENDIF.Second, it is overly complex.
LOOP AT t_bsid_zpp_zpr WHERE zterm = 'ZPP ' AND ( blart = 'SS' OR blart = 'SR' ).
APPEND z_bsid_zpp_zpr TO t_bsid.
ENDLOOP.
IF NOT t_bsid[] IS INITIAL.
record-blart_002 = 'P7'.
PERFORM sub_process_records.
ENDIF.matt
‎2007 Dec 04 11:14 AM
There is a possible issue I've just noticed. Is the space after ZPP necessary?
matt