Skip to Content
author's profile photo Former Member
Former Member

Select statement not populating the internal table

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2010 at 03:56 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 13, 2010 at 03:55 AM

    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.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2010 at 03:56 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 13, 2010 at 03:57 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.