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 with Data Selection from AFKO

Former Member
0 Likes
1,928

Hello All

Thers a litte Problem with an Selection From AFKO.

Field Pronr

The coding ist simple

TAbles: AFKo

DATA: it_afko like AFKO.

Select single * From AFKO into table it_afko.

But the entries in der internal Table It_Afko are not korrekt. The Entry must bei the Same like in TA SE16.

but is is not.

For Pronr From the selection is 0010000

But from the Tabel AFKO P.123456

Any Idear ??

Thanks for your help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,377

Hi Christian,

To get the value as show in SE16

you will have to do the following


Select * From AFKO into table it_afko.

loop at it_afko.

call FM CONVERSION_EXIT_KONPD_OUTPUT
to convert it_afko-PRONR

modify it_afko index sy-tabix.

endloop.

Sameena

Message was edited by: sameena attarwala

10 REPLIES 10
Read only

Former Member
0 Likes
1,377

Christian,

Make your query as.

Select * From AFKO into table it_afko.

single will select only one line.

rgds,

TM

Read only

0 Likes
1,377

The Coding ist korrekt. But the Problem ist not the Selection. I the DATAfield PRONR (N 8). The a convertion exit for this Field, but i does´nt work.

Read only

0 Likes
1,377

Hi,

data selected using select statement into internal table ; will be form present in the database.

if want to remove leading zero use CONVERSION_EXIT_ALPHA_OUTPUT

if u want to add leading zero use CONVERSION_EXIT_ALPHA_INPUT.

regards

Read only

0 Likes
1,377

u can loop at table and use CONVERSION_EXIT_ALPHA_INPUT

loop at it_afko.

  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = it_afko-pronr
 IMPORTING
   OUTPUT        = it_afko-pronr.
   modify it_afko index sy-tabix.       
endloop.

Read only

Former Member
0 Likes
1,377

dont use select single.

put like this

select aufnr from afko

into corresponding fields of it_afko

where pronr in s_pronr.

Regards

Prabhu

Read only

Former Member
0 Likes
1,377

if u use select single u have to use where condirtion.

Select single * From AFKO into it_afko where aufnr = p_aufnr.

Read only

Former Member
0 Likes
1,377

Hi Christian,

can you please be a bit more specific? I guess you´ve checked in debugging, that the line selected via your statement is the one you have viewd via se16. So what should your conversion do? Is the value wrong in printing?

I would go with the others and ask you to check the selection.I´ve you´ve done so, maybe you have some more information for us.

Thanx

Ute

Read only

0 Likes
1,377

Hello Christian,

the field PRONR (Projectdefinition) has a conversion exit. SE16 shows you the external format - from selection you get the internal format.

To switch between both use the functions

CONVERSION_EXIT_KONPD_INPUT

CONVERSION_EXIT_KONPD_OUTPUT

Regards Wolfgang

Read only

0 Likes
1,377

Hello Ute

The Output with Write (for Pronr) Ist P.10000

But the Entry in the internal Table It_Afko

is 0002345.

And Thats my Problem. I use Pronr for an other Selection, but i does'nt works.

Do you need more details ??

Read only

Former Member
0 Likes
1,378

Hi Christian,

To get the value as show in SE16

you will have to do the following


Select * From AFKO into table it_afko.

loop at it_afko.

call FM CONVERSION_EXIT_KONPD_OUTPUT
to convert it_afko-PRONR

modify it_afko index sy-tabix.

endloop.

Sameena

Message was edited by: sameena attarwala