Application Development 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: 

Problem in Function module

former_member1050074
Participant
0 Kudos
399

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

shishupalreddy
Active Contributor
0 Kudos
199

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

shishupalreddy
Active Contributor
0 Kudos
200

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,

former_member188685
Active Contributor
0 Kudos
199

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.

Former Member
0 Kudos
199

Hi,

change ur select to:

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

Rgds,

Pavan

0 Kudos
199

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

0 Kudos
199

Hello,

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

Regards

0 Kudos
199

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

Former Member
0 Kudos
199

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