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

POPUP_GET_VALUES_DB_CHECKED - Match code info

luis_rod
Participant
0 Likes
3,242

Hi all,

I’m trying to use the POPUP_GET_VALUES_DB_CHECKED function for selecting the LIFNR column in a (Z) view that is a sub select of the LFA1 table.

My problem is that, when I select the match code (F4) in the function, the help data shown is, of course, the help data for the LFA1-LIFNR column, that is, all the table (not my Z View).

Is there any way to make the function’s match code select ONLY the data as referenced by my view?

Thanks in advance,

Luis

1 ACCEPTED SOLUTION
Read only

michael_piesche
Active Contributor
0 Likes
2,534

(A) How does FM POPUP_GET_VALUES_DB_CHECKED work?

  1. The FM does not help you with the preselection, filtering, checking of search helps (F4).
  2. The search help for a field in this FM is taken from the definition of the search help parameter for a field of the table (e.g. LFA1-LIFNR has seach help KRED_C in tab 'entry help/check')
  3. It only helps you, after the F4-selection or the manual input, with checking that value against actual DB values, either directly from the defined table, or from a comparison table (see report RSSPO420 and the coding of example 3).
  4. So if you call the FM and you use the search help which refers to values of LFA1, you can see all LFA1 values. And you can still select a value from the search help that doesnt exist in your custom view, but you will get an error when you want to move on with the popup because of the missing value in your custom view.

(B) How to solve your problem?

In order to solve your problem with presenting the right search help records, you could write your own custom elementary search help:

  1. Copy the elementary search help 'KREDA' into a custom elem. search help (e.g. 'Zf4help4view')
  2. In the selection method of the new search help you will exchange 'M_KREDA' with your custom View for LFA1 (e.g. 'Zlfa1zview'). You might have to do further adjustments, depending on the available fields of your view. Your custom view should be of type 'Help View', which is assigned when you create the view.
  3. Copy the data element 'LIFNR' and create a custom data element (e.g. 'Zlifnr') and change its search help KRED_C with the just created search help from above (e.g. Zlfa1zview).
  4. In your custom View for LFA1 'Zlfa1zview', you will now exchange the data element of the attribute LIFNR with your own custom data element 'Zlifnr'.
  5. When you call the FM POPUP_GET_VALUES_DB_CHECKED now and you use your custom view as TABNAME and the LIFNR as FIELDNAME, the search help will now be based on the values of your view, and not on the values of LFA1.

Hi all,

I’m trying to use the POPUP_GET_VALUES_DB_CHECKED function for selecting the LIFNR column in a (Z) view that is a sub select of the LFA1 table.

My problem is that, when I select the match code (F4) in the function, the help data shown is, of course, the help data for the LFA1-LIFNR column, that is, all the table (not my Z View).

Is there any way to make the function’s match code select ONLY the data as referenced by my view?

Thanks in advance,

Luis

7 REPLIES 7
Read only

michael_piesche
Active Contributor
0 Likes
2,535

(A) How does FM POPUP_GET_VALUES_DB_CHECKED work?

  1. The FM does not help you with the preselection, filtering, checking of search helps (F4).
  2. The search help for a field in this FM is taken from the definition of the search help parameter for a field of the table (e.g. LFA1-LIFNR has seach help KRED_C in tab 'entry help/check')
  3. It only helps you, after the F4-selection or the manual input, with checking that value against actual DB values, either directly from the defined table, or from a comparison table (see report RSSPO420 and the coding of example 3).
  4. So if you call the FM and you use the search help which refers to values of LFA1, you can see all LFA1 values. And you can still select a value from the search help that doesnt exist in your custom view, but you will get an error when you want to move on with the popup because of the missing value in your custom view.

(B) How to solve your problem?

In order to solve your problem with presenting the right search help records, you could write your own custom elementary search help:

  1. Copy the elementary search help 'KREDA' into a custom elem. search help (e.g. 'Zf4help4view')
  2. In the selection method of the new search help you will exchange 'M_KREDA' with your custom View for LFA1 (e.g. 'Zlfa1zview'). You might have to do further adjustments, depending on the available fields of your view. Your custom view should be of type 'Help View', which is assigned when you create the view.
  3. Copy the data element 'LIFNR' and create a custom data element (e.g. 'Zlifnr') and change its search help KRED_C with the just created search help from above (e.g. Zlfa1zview).
  4. In your custom View for LFA1 'Zlfa1zview', you will now exchange the data element of the attribute LIFNR with your own custom data element 'Zlifnr'.
  5. When you call the FM POPUP_GET_VALUES_DB_CHECKED now and you use your custom view as TABNAME and the LIFNR as FIELDNAME, the search help will now be based on the values of your view, and not on the values of LFA1.
Read only

0 Likes
2,534

Michael,

Thanks for your help. Regarding your B(3) step, I can't find how to change the search help for my custom view (which, by the way, is a join file view (LFA1 + LFBK). It could be that our SAP version is quite old (7.00, I think).

Another way could be, of course, create a new data element (with the search help already specified) and change the original data element in my Z view.

Thanks again,

Luis

Read only

0 Likes
2,534

377cae7333c044888184eb2537b4355e, you are right, I jumped the gun, you cant change the 'search help' of an attribute in a view, at least I didnt find a solution for it right away.

But what will definitly work is to change the data element in your view to one that has your search help of your view. And your view might have to be of type "Help View", so you might have to 'change' it (delete and recreate) or create another view. At least in my test I used type *Help View".

  • ZVIEW with attribute LIFNR with datatype ZLIFNR with search help ZKREDA with help-view ZVIEW
Read only

0 Likes
2,534

377cae7333c044888184eb2537b4355e, I updated the steps in how to solve the problem by including the information about creating also a data element utilizing the search help and exchanging the standard data element of lifnr in your view with the custom one.

Let me know if it works for you now.

Read only

0 Likes
2,534

Michael,

Thanks for your posts. Will check the idea of changing the data element later today and will let you know (I'm at -4:00 UTC).

Thanks again,

Luis

Read only

0 Likes
2,534

377cae7333c044888184eb2537b4355e, were you able to solve your problem or are you still having the same or new difficulties?

Read only

0 Likes
2,534

Michael,

My apologies for not answering your posts earlier. Hectic times at the office 🙂

A first attempt gave the same problems. I’m afraid that particular program got sidetracked due to another, higher priority project. I haven’t closed the question in the forum because I hope to be able to retake that particular code soon.

Regards,

Luis Rodriguez