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

Problem in Function module

Former Member
0 Likes
1,286

Hi Friends..

I am using EXIDV and EXIDV2 field in function module.

I am using HU number as a import parameter, depends on user input some times its a EXIDV value and some times its a EXIDV2 value.

if HU number is a EXIDV value,no problem in function module, but I gave EXIDV2 value in function module its not come into coding part...instead of first i can't able to use second select ..find the below coding..

-


SELECT SINGLE vhilm FROM vekp into vhilm WHERE exidv = hu AND status NE '0060'.

*SELECT SINGLE vhilm FROM vekp into vhilm WHERE exidv = hu AND status NE '0060'.

IF sy-subrc NE 0.

status = '999'.

CONCATENATE hu 'HU does not exist in SAP' INTO

message SEPARATED BY space.

EXIT.

ELSE.

status = '000'.

CONCATENATE hu 'HU exist in SAP' INTO

message SEPARATED BY space.

ENDIF.

-


if anybody have idea about this kindly let me know..

Thanks

Gowrishankar

1 ACCEPTED SOLUTION
Read only

shishupalreddy
Active Contributor
0 Likes
1,086

Hello

Change u r query by including the EXDIV2 field also in where condition,

SELECT SINGLE vhilm FROM vekp into vhilm WHERE status NE '0060'

and ( exidv = hu or exdiv2 = hu ).

Becasue sometimes it may be avaialble in Handling Unit's 2nd External Identification (EXDIV2) field.

Hope it will be helpful.

Regards,

7 REPLIES 7
Read only

shishupalreddy
Active Contributor
0 Likes
1,087

Hello

Change u r query by including the EXDIV2 field also in where condition,

SELECT SINGLE vhilm FROM vekp into vhilm WHERE status NE '0060'

and ( exidv = hu or exdiv2 = hu ).

Becasue sometimes it may be avaialble in Handling Unit's 2nd External Identification (EXDIV2) field.

Hope it will be helpful.

Regards,

Read only

Former Member
0 Likes
1,086

Did you check the table VEKP with EXIDV2 value what ever is coming to the function. Try Debugging and see what value you are passing to the function and check it in the table.

Read only

Former Member
0 Likes
1,086

Hi,

change ur select to:

SELECT SINGLE vhilm FROM vekp into vhilm WHERE (exidv = hu or exdiv2 = hu) AND status NE '0060'.

Rgds,

Pavan

Read only

0 Likes
1,086

hi all

Thanks for your replies..

still the problem continues..if incoming value is EXIDV field its not a problem, if EXIDV2 values is passed

no values updated in the table after select statement.

so..again aconfusing..after debugging also it continues like that..

Thanks

Gowrishankar

Read only

0 Likes
1,086

Hello,

Please check the HU value is available in vkep under exdiv or exdiv2 ......

Regards

Read only

0 Likes
1,086

ya its availbale..I used different HU value..if I used value related with EXIDV it passed perfectly..if I used value related with EXIDV2, no values selected in select statement.

Thanks

Gowrishankar

Read only

Former Member
0 Likes
1,086

Hi,

I think hu should be in quotes like 'hu'

Write like this

SELECT SINGLE vhilm FROM vekp into vhilm

WHERE (exidv = 'hu' or exdiv2 = 'hu') AND status NE '0060'.

Regards,

Kumar Bandanadham