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: 

F4 on LIFNR fails to capture the values in SELECT statement

former_member184657
Active Contributor
0 Kudos
1,482

Hi all,

In the last 3 days Ive faced two issues on F4 Helps and its freaking me out.

The first issue I chose to ignore because of time-constraints and able to find a work-around.

On the second issue Ive hit a brick-wall.

Anyways here are my two issues.

Issue I:

I developed a custom report and in that Ive defined a selection-field(among half a dozen others) as follows:

select-options: s_matnr for ekpo-matnr.

On execution when I press F4 on matnr field I get the standard F4 Help. And then when i select the Material I want and hit Enter, the selected value fails to reflect in the Input Screen field. I continues to show blank as if Ive not selected anything. Not surprisingly the Report output was fetching the undesired results.

Later I changed the declared to:

select-options: s_matnr for mara-matnr.

And it worked. However because of time constraints I did not dwelve into it anymore.

This bring me to the Issue II:

For a different Custom Report Ive defined Select_Options on LIFNR as follows:

select-options: s_lifnr for lfa1-lifnr.

Now the issue I face here is slighly different.

On hitting F4 on the LIFNR field Im getting the standard F4 Help, and on selection Im getting the desired Vendor Number on the input screen.

But the problem is while executing the report its not fetching me the records relevant to the selected LIFNR. In debugging it does show me that LIFNR contains the value but surprisingly its not returning any values to the Internal Table.

Im out of ideas at this point of time, trying to figure out whats wrong.

Any ideas on what could be wrong??

pk

PS: Im not using any function modules for the F4 help. Just the straight-forward Standard F4 functionality.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
816

This is probably caused by a missing cal to FM CONVERSION_EXIT_ALPHA_INPUT

Rob

28 REPLIES 28

Former Member
0 Kudos
816

And what table/field are you checking for LIFNR.

EKKO-LIFNR. Are there records actually on the table.

0 Kudos
816

Hi Martin,

What I have is a custom table in which Ive directly defined field name as LIFNR and Data Element as LIFNR. (so it automatically takes all characteristics of LIFNR)

My Custom table has data corresponding to the LIFNR value Im inputing. But in my SELECT statement even though s_lifnr has the value IEQ0020000000, it fails to return anything into the Internal Table.

pk

0 Kudos
816

Seeing the code would be useful.

0 Kudos
816

Selection-Screen:

tables: zpst001, mseg, lfa1.

selection-screen: begin of block b1 with frame title text-000.

select-options: s_tno for zpst001-tno.
select-options: s_ebelp for zpst001-ebelp.
select-options: s_pspid for zpst001-pspid.
select-options: s_lifnr for lfa1-lifnr.
select-options: s_werks for zpst001-werks.
select-options: s_pick for zpst001-pick.
select-options: s_status for zpst001-pstatus.

selection-screen: end of block b1.

Select statement:

select * from zpst001 into corresponding fields of table ist_zpst001
       where tno     IN s_tno
       and   ebelp   IN s_ebelp
       and   pspid   IN s_pspid
       and   lifnr   IN s_lifnr
       and   werks   IN s_werks
       and   pick    IN s_pick
       and   pstatus IN s_status.

I dont know if this would help... but then who knows

pk

0 Kudos
816

While using select-options why dont use standard tables to declare variiables

0 Kudos
816

>

> What I have is a custom table in which Ive directly defined field name as LIFNR and Data Element as LIFNR. (so it automatically takes all characteristics of LIFNR)

> My Custom table has data corresponding to the LIFNR value Im inputing. But in my SELECT statement even though s_lifnr has the value IEQ0020000000, it fails to return anything into the Internal Table.

>

> pk

if Rob's advise was helpful, than it looks like that the domain in the custom table for the field is not lifnr

0 Kudos
816

>

if Rob's advise was helpful, than it looks like that the domain in the custom table for the field is not lifnr

Yes I thought it could be either.

And the domain should probably be changed, but this might cause compatability issues.

Rob

Edited by: Rob Burbank on Nov 19, 2008 11:37 AM

0 Kudos
816

Ramchander,

I know using lifnr-low is not the ideal solution. It will only fetch me results for single entry only. I was just trying a bunch of stuff and settled on this temporarily.

Theres lot more clean-up to be done.

Eric,

This means that the vendor numbers were saved into the Z... table without using the conversion exits.

That, I feel is a very valid point. The Vendor numbers were saved into the Ztable without the conversion routines. Funny, I never felt the need to such a thing

Will try it out at the earliest. I have strong gut-feeling that mite work.

pk

My aplogies to everyone if I dont reply to this thread until Monday morning. Will be away till then for some Internal training sessions over the weekend.

Edited by: prashanth kishan on Nov 20, 2008 5:41 PM

0 Kudos
816

Allright everybody stay put... I think Im very close to unravelling the mystry behind the LIFNR headache.

Based on Eric's advice on how I was updating LIFNR in the Ztable, I went back to check on it and I find that I made a small(well..not really small) goof-up there.

I was already using the Conversion routine in my save program and had swapped the input/output fields there. Which means I was updating the wrong entries into the Ztable.

The end-result being instead of storing the Vendor number as '0020000000', it was getting saved as '20000000'. And hence the problem fetching the records.

Yes thats right. I feel like kicking myself now. I havent thoroughly tested it yet but Im confident it would work. But it would have to wait until Monday. Right now I need to treat myself to some great fun. I deserve that(Not beacause Ive solved the issue, but because its my Birthday today ).

Allrighty. Thanks everybody for their time and inputs.

You all have a great weekend.

pk

0 Kudos
816

Hey Prashanth,

HAPPY BIRTHDAY.

I told you in my reply to your thread about the char10 value of LIFNR and you said that your client want it as 8 char.

Anyways, Enjoy the day.. it's your birthday.

Cheers,

Jayant

Former Member
0 Kudos
816

Seems, the value that you are passing in the selection screen are not present in the custom table from which you are fetching the data. Please check for the values in the custom table, should satisfy all the selection criteria that you have defined in your selection screen and select query.

Thanks,

Jayant

0 Kudos
816

Hi Jayant,

I did a physical count on the number of records in my table with LIFNR '20000000' and its 8 out of the total 39 records.

Now interestingly when I tried to search values from my Custom Table through F4 it doesnt return any values just like my SELECT statement.

But as I said a physical count gives me 8 records for a particular input. Now this compunds my problems

@ K.P.N: I donot have problems with any of the inputs except LIFNR. And LIFNR is defined as LFA1-LIFNR

pk

Edited by: prashanth kishan on Nov 19, 2008 7:51 PM

0 Kudos
816

What data element are you using for LIFNR on your custom table.

0 Kudos
816

As I mentioned in my second post, both Field Name and Data Element are LIFNR.

I have a gut-feeling if I should be using ELIFN as the Data Element instead of LIFNR. So let me just try that out.

pk

Update: ELIFN is a no-go.

Edited by: prashanth kishan on Nov 19, 2008 8:00 PM

0 Kudos
816

Hello Prashanth,

LIFNR is char10 value. You said that entry in your table is maintained as '20000000' but what is the value that you F4 help is returning. Also, have you used the data element LIFNR in you custom table because the data element has got a search help attached name: KRED_C, which is returning right value for me. (Have tried)

Strange Problem.

Jayant Sahu

0 Kudos
816

Yes, LIFNR is char10 and in our organization all Vendor numbers are 8 digit characters.

In my custom table I can see that the Search-Help KRED_C is maintained and Im indeed getting the search help when I press F4. The bothers me is, why is it not fetching any records for that selection?

pk

JozsefSzikszai
Active Contributor
0 Kudos
816

regarding issue #1:

replace:

select-options: s_matnr for ekpo-matnr.

with

select-options: s_matnr for ekpo-ematn.

Now the search help will work (this is some issue with the search help, just check table EKPO in SE11 - I have no idea what is the difference between ekpo-matnr and ekpo-ematn)

regarding issue #2:

isn't any exclude in the other select options?

Former Member
0 Kudos
816

>

> Issue I:

> I developed a custom report and in that Ive defined a selection-field(among half a dozen others) as follows:

>

select-options: s_matnr for ekpo-matnr.

> On execution when I press F4 on matnr field I get the standard F4 Help. And then when i select the Material I want and hit Enter, the selected value fails to reflect in the Input Screen field. I continues to show blank as if Ive not selected anything. Not surprisingly the Report output was fetching the undesired results.

> Later I changed the declared to:

>

select-options: s_matnr for mara-matnr.

> And it worked. However because of time constraints I did not dwelve into it anymore.

.

Explicitly assigning a matchcode object seems to bring back the selected value to the screen field

SELECT-OPTIONS:
  s_matnr FOR ekpo-matnr MATCHCODE OBJECT S_MAT1.

0 Kudos
816

Eric,

My first issue was solved when i replaced

select-options: s_matnr for ekpo-matnr.

with

select-options: s_matnr for mara-matnr.

though I have no clue why that happens.

regarding issue #2:

isn't any exclude in the other select options?

Im sorry I did not get what you meant. If you meant what about the other select-options, then I can say that they are all working fine with the exception of LIFNR.

Rajesh,

Giving the Matchcode Object KRED_C was the first thing I tried. Yet nothing there too.

Rob,

Giving the Conversion Exit was the second thing I tried. Nothing there too. Conversion is returning the same value and the result is a no-go.

pk

Edited by: prashanth kishan on Nov 19, 2008 8:29 PM

Edited by: prashanth kishan on Nov 19, 2008 8:31 PM

0 Kudos
816

>

>

regarding issue #2:

> isn't any exclude in the other select options?

I meant here that you can exclude values in select options, for example you told there are 8 items for the vendor in the Z... table, let's say all these 8 items use the same material number, but (whatever reason) this material number is excluded from the selection in s_matnr (it is just an example, there could be many variations, you have a number of select options)

Former Member
0 Kudos
817

This is probably caused by a missing cal to FM CONVERSION_EXIT_ALPHA_INPUT

Rob

0 Kudos
816

Rob,

On the contrary I just tried CONVERSION_EXIT_ALPHA_OUTPUT instead of CONVERSION_EXIT_ALPHA_INPUT and it worked.

Thanks a bunch anyways

But like an unsatisfied client let me continue with the question.

Why a search through SE11 doesnt return any values?

Conversion Routine ALPHA is maintained in my Custom Table. Then what seems to be the problem.

Rajesh, Thanks a lot for the Note. Now atleast I know theres something wrong out there

pk

PS: Signing off from a looong day

Will check the subsequent replies on the morrow.

Edited by: prashanth kishan on Nov 19, 2008 8:37 PM

0 Kudos
816

>

> But like an unsatisfied client let me continue with the question.

> Why a search through SE11 doesnt return any values?

..OSS doesnu2019t says what is the root cause of this conflict.

The actual Reason: is that search help of EKPO-MATNR is inherited from MARA-MATNR (no matter both indicates MAT1) but there are further three different parameter for MATNR in MAT1.

Infect both referenced to same search help MAT1, but if you look little bit depth you will be able to see EKPO-MATNR have a different parameter attached which is MATNR_B, and the same parameter (MATNR_B) is blank for MARA-MATNR in SE11>MARA>Entry Help/Check>Push Button (Search help).

Following Justification can be seen by just following the path: SE11>EKPO/MARA>Entry Help/Check>than click on SEARCH HELP push button

There are three Search help parameter for MATNR in MAT1 is

MATNR
MATNR_B
MATNR_HTN

Here you can see the search help structure for MATNR (EKPO, MARA)

MATNR	    EKPO	  EMATN
MATNR_B	    EKPO	  MATNR

MATNR	  MARA	MATNR	                              
MATNR_B	"And this is blank in MARA

At time of F4 for EKPO-MATNR system looks MATNR_B to MATNR and this is blank for MARA-MATNR,hence the result is nothing selected on selection-screen.

And this also suggests why search help is working with EKPO-EMATN and why not with EKPO-MATNR.

This is the reason why you are not getting Values in selection-screen from select-options: s_matnr for ekpo-matnr.

Cheers,

Amit

0 Kudos
816

>

> I meant here that you can exclude values in select options, for example you told there are 8 items for the vendor in the Z... table, let's say all these 8 items use the same material number, but (whatever reason) this material number is excluded from the selection in s_matnr (it is just an example, there could be many variations, you have a number of select options)

What you say makes sense, but firstly I dont have a MATNR in my table and from the looks of it, its not advisable to use any other common field either. A vendor-wise search is of primary importance in this table. So cant really exclude that.

if Rob's advise was helpful, than it looks like that the domain in the custom table for the field is not lifnr

Well the Domain has always been LIFNR regardless of which Data Element I used.

And the domain should probably be changed, but this might cause compatability issues.

Rob,

What kind of compatibility issues are you talking about? What I have right now is a custom table with some test data. So I guess its ok to change the Domain and Data Elements as I wish and Adjust the Table. Right?

@Amit: I will look at your inputs a little more carefully and get back to you. Right now Im a little tied-up with other issues.

Thanks everyone.

pk

Update:

So... as I said earlier, when I used CONVERSION_EXIT_ALPHA_OUTPUT on LIFNR the selection on LIFNRs worked just fine. But unfortunately the rest of the select-options returned zero results(if I left the LIFNR select-option blank). I found the reason to be that because of the conversion routine the LIFNR values are taken as space. So i guess its looking into the database table for blank values of LIFNR, which is never the case and hence no values returned. Anyways, I found a work-around for this and for the moment its working fine...to some extent.

Only constraint being that I cannot enter a range of values for LIFNR.

Heres the code Im using right now. Thought it might be useful for future references or somebody wants to fine-tune it, is welcome to do so.

if s_lifnr-low = space.

select * from zpst001 into corresponding fields of table ist_zpst001
       where tno     IN s_tno
       and   ebelp   IN s_ebelp
       and   pspid   IN s_pspid
       and   werks  IN s_werks
       and   pick    IN s_pick
       and   pstatus IN s_status.

else.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    INPUT         = s_lifnr-low
 IMPORTING
   OUTPUT        = s_lifnr1-low
          .

select * from zpst001 into corresponding fields of table ist_zpst001
       where tno     IN s_tno
       and   ebelp   IN s_ebelp
       and   pspid   IN s_pspid
       and   lifnr   eq s_lifnr1-low
       and   werks   IN s_werks
       and   pick    IN s_pick
       and   pstatus IN s_status.

endif.

pk

Edited by: prashanth kishan on Nov 20, 2008 5:08 PM

0 Kudos
816

>

>

if Rob's advise was helpful, than it looks like that the domain in the custom table for the field is not lifnr

> Well the Domain has always been LIFNR regardless of which Data Element I used.

This means that the vendor numbers were saved into the Z... table without using the conversion exits.

>

> Heres the code Im using right now. Thought it might be useful for future references or somebody wants to fine-tune it, is welcome to do so.

>

>

if s_lifnr-low = space.
> 
> select * from zpst001 into corresponding fields of table ist_zpst001
>        where tno     IN s_tno
>        and   ebelp   IN s_ebelp
>        and   pspid   IN s_pspid
>        and   werks  IN s_werks
>        and   pick    IN s_pick
>        and   pstatus IN s_status.
> 
> else.
> 
> CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
>   EXPORTING
>     INPUT         = s_lifnr-low
>  IMPORTING
>    OUTPUT        = s_lifnr1-low
>           .
> 
> select * from zpst001 into corresponding fields of table ist_zpst001
>        where tno     IN s_tno
>        and   ebelp   IN s_ebelp
>        and   pspid   IN s_pspid
>        and   lifnr   eq s_lifnr1-low
>        and   werks   IN s_werks
>        and   pick    IN s_pick
>        and   pstatus IN s_status.
> 
> endif.

I wonder how this works, because s_lifnr-low refers to the header line of the select option... It also cannot work when there are more lines in the select options. I just would do this:

IF s_lifnr[] IS NOT INITIAL.
LOOP AT s_lifnr.
IF s_lifnr-low IS NOT INITIAL.
==> conversion on s_lifnr-low.
ENDIF.
IF s_lifnr-high IS NOT INITIAL.
==> conversion on s_lifnr-high.
ENDIF.
MODIFY s_lifnr.
ENDLOOP.
ENDIF.

=> now select (as earlier with all select options)

Former Member
0 Kudos
816

Also, check the oss note 394039, it says

The search help of field *EKPO-MATNR* is not suitable for selection
screens and must be replaced with search help MAT1 on the selection
screens.

former_member1245113
Active Contributor
0 Kudos
816

please note my understanding is correct

i think you are using a select options for lifnr.

if so.

in the select query use lifnr-low not lifnr.

according to the value you have mentioned there its value is as IEQ----

SO use lifnr-low.

or in where condition instead of using EQ use IN.

inspite of the above mentioned ones if you still find it the same

try using conversion exit if the LIFNR data element contain one.

hope this will serve your purpose.

regards

Ramchander Rao.K

Former Member
0 Kudos
816

change the select-options statement as below it will solve u r issue 1

SELECT-OPTIONS: S_MATNR FOR EKPO-MATNR MATCHCODE OBJECT MAT1.