‎2008 May 07 11:22 AM
Hi all,
am always getting into the if condition even though am giving vbeln values that are in vbrk table,plz help me...
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_vbeln like vbrk-vbeln OBLIGATORY,
P_time like SY-UZEIT.
SELECTION-SCREEN END OF BLOCK b1.
IF p_vbeln NE VBRk-VBELN.
MESSAGE i012(zmsg).
ENDIF.
‎2008 May 07 12:02 PM
Hi,
Use the below code.
data: wa_vbeln type vbrk-vbeln.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_vbeln like vbrk-vbeln OBLIGATORY,
P_time like SY-UZEIT.
SELECTION-SCREEN END OF BLOCK b1.
at selection-screen.
select single vbeln from vbrk into wa_vbeln where vbeln = p_vbeln.
if sy-subrc ne 0.
MESSAGE 'Not a valid one' type 'E'.
ENDIF.
Edited by: Velangini Showry Maria Kumar Bandanadham on May 7, 2008 1:03 PM
‎2008 May 07 11:25 AM
Hi
Before using IF condition do
data: l_vbeln type vbeln.
call function 'conversion_exit_alpha_input'.
exporting
v1 = p_vbeln
importing
v1 = l_vbeln
It converts your parameter value into internal format. i mean ex '0000001234'
Aditya
‎2008 May 07 11:25 AM
Hi,
VBRK-VBELN ? I hope you have got select from VBRK just before this. Just check the contents of both, by putting the stetement break-point. in the code. Mostly it will question of leading zeros in VBRK-VBELN.
If that is the case just use FM CONVERSION_EXIT_ALPHA_INPUT for p_vbeln.
I hope this helps,
Regards
Raju Chitale
Edited by: Raju Chitale on May 7, 2008 12:26 PM
‎2008 May 07 11:42 AM
thank u all,
even though i called that function,still the if condition is satisfying...will u tell me some other ways..
‎2008 May 07 11:44 AM
Hi,
u r checking with database value directly. u cant do that. first u have to select all vbeln from vberk table into an internal table and then loop that internal table and check the if condition.
hope it may help u.
‎2008 May 07 11:56 AM
hi
good
try to comment the if statement and than see the difference while debugging , than you try to change the code of if statement and see the difference.
thanks
mrutyun^
‎2008 May 07 12:02 PM
Hi,
Use the below code.
data: wa_vbeln type vbrk-vbeln.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_vbeln like vbrk-vbeln OBLIGATORY,
P_time like SY-UZEIT.
SELECTION-SCREEN END OF BLOCK b1.
at selection-screen.
select single vbeln from vbrk into wa_vbeln where vbeln = p_vbeln.
if sy-subrc ne 0.
MESSAGE 'Not a valid one' type 'E'.
ENDIF.
Edited by: Velangini Showry Maria Kumar Bandanadham on May 7, 2008 1:03 PM
‎2008 May 07 12:13 PM
Hi,
Are you using direct DB table VBRK... Am bit confused with your question.
However you can use
Select single * from vbrk
where vbeln = p_vbeln.
if sy-subrc ne 0.
(give ur msg error)
exit.
endif.
Reward points if useful.
Regards,
Anu.