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

Select statement not populating the internal table

Former Member
0 Likes
1,079

Hi,

I have a requirement where I have to upload a file from C drive, the fields in this file are VBELN, description & date of creation.

I am able to get this file into the internal table. After this i need to cross check the VBELN against VBRK-VBELN, if present then update a Z-table.... How do I do the cross check part ?...

if not tw_zvatcn[] is initial,

select * from vbrk

into table tw_vbrk

for all entries in tw_zvatcn

where vbeln = tw_zvztcn-vbeln

and vkorg = p_vkorg.

if sy-subrc = 0.

modify ztzb from lw_zvatcn.

endif.

endif.

Internal table tw_vbrk is coming blank, which is not correct because I see the data in db tbl VBRK

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
913

Hi

Once you get the data from c drive to internal table, modify all VEBLN of tw_zvatcn[] into SAP format using function module CONVERSION_EXIT_ALPHA_INPUT. This might solve ur issue.

Regards

Sachin

5 REPLIES 5
Read only

GauthamV
Active Contributor
0 Likes
913

Is p_vkorg a parameter or select option.

If it is parameter and is blank you will not get data in the table.

In that case make a condition for that field also.


if not tw_zvatcn[] is initial.
if p_vkorg is not initial.
select * from vbrk
into table tw_vbrk
for all entries in tw_zvatcn
where vbeln = tw_zvztcn-vbeln
and vkorg = p_vkorg.
if sy-subrc = 0.
modify ztzb from lw_zvatcn.
endif.
else.
select * from vbrk
into table tw_vbrk
for all entries in tw_zvatcn
where vbeln = tw_zvztcn-vbeln.
if sy-subrc = 0.
modify ztzb from lw_zvatcn.
endif.
endif.
endif.

Read only

Former Member
0 Likes
913

Thank You Gautham, but p_vkorg is obligatory in teh selection-screen.

Read only

Former Member
0 Likes
914

Hi

Once you get the data from c drive to internal table, modify all VEBLN of tw_zvatcn[] into SAP format using function module CONVERSION_EXIT_ALPHA_INPUT. This might solve ur issue.

Regards

Sachin

Read only

Former Member
0 Likes
913

Hi,

Check if there are any entries in table "vbrk" with vbeln and p_vkorg combination.

Also check if you need to use conversion exit for field "VBELN".

Regards,

Srini.

Read only

alex_cook
Active Participant
0 Likes
913

Howdy,

Make sure the VBELN data in your internal table has leading zeros, eg instead of 90000123 you need 009000123.

To do the conversion use FM CONVERSION_EXIT_ALPHA_INPUT.

Cheers

Alex