Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

URGENT-PROBLEM WITH VARIABLE VALUE

Former Member
0 Likes
785

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
765

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

7 REPLIES 7
Read only

Former Member
0 Likes
765

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

Read only

Former Member
0 Likes
765

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

Read only

0 Likes
765

thank u all,

even though i called that function,still the if condition is satisfying...will u tell me some other ways..

Read only

Former Member
0 Likes
765

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.

Read only

Former Member
0 Likes
765

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^

Read only

Former Member
0 Likes
766

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

Read only

anub
Participant
0 Likes
765

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.