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: 

problem with concatenate for an drop down input with search help

Former Member
0 Kudos

I have this drop down input field. My table has these columns : code, first name, last name and other not important.

I have a search help for code column that shows the first name.

I`ve been trying to make it to show the first name and last name both in one dropdown....but when I tried to add the last name in the search help it stopped working (the non recommended example from the link).

I also tried an select, loop at the itab and trying to concatenate those 2 columns in a new column of a second itab. It works but it shows only first name.

I`ve been using the recommended example for the drop down from here : http://help.sap.com/SAPhelp_nw04s/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

Let me know if you need to see the exact code I`m using.

Sure you guys can help me out....probably I`m missing something very simple.

Regards,

Newbie Ilinca

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You are concatenating the first & last name into KEY field or TEXT field ?

6 REPLIES 6

Former Member
0 Kudos

You are concatenating the first & last name into KEY field or TEXT field ?

0 Kudos

Neither... the first example is not with KEY or TEXT....

I`m not using VRM_SET_VALUES as in the second example I`m using F4IF_INT_TABLE_VALUE_REQUEST.

I`m using the first example: http://help.sap.com/SAPhelp_nw04s/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

What I`ve been trying:

types: begin of t_cod_angajat,

cod_angajat type zangajati-cod_angajat,

nume type zangajati-nume,

prenume type zangajati-prenume,

END OF t_cod_angajat.

types: begin of t_cod_angajat1,

cod_angajat type zangajati-cod_angajat,

nume type zangajati-nume,

prenume type zangajati-prenume,

END OF t_cod_angajat1.

types: begin of t_cod_angajat2,

cod_angajat type zangajati-cod_angajat,

nume type zangajati-nume,

END OF t_cod_angajat2.

DATA: itab_cod type standard table of t_cod_angajat with header line,

itab_cod1 type standard table of t_cod_angajat1 with header line,

itab_cod2 type standard table of t_cod_angajat2 with header line.

.....

MODULE create_dropdown_box INPUT.

SELECT cod_angajat nume prenume

FROM zangajati

INTO CORRESPONDING FIELDS OF TABLE itab_cod.

LOOP AT itab_cod into itab_cod1.

itab_cod2-cod_angajat = itab_cod1-cod_angajat. ''cod_angajat is the key in my table

CONCATENATE itab_cod1-nume itab_cod1-prenume into itab_cod2-nume.

APPEND itab_cod1 to itab_cod2.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'COD_ANGAJAT'

value_org = 'S'

TABLES

value_tab = itab_cod2

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

endmodule.

.....Which is useless....because my program is showing only the first name = nume.

0 Kudos

I dont understand your logic in populating the contatenated value. The concatenated value is stored in ITAB_COD2-NUME but the ITAB_COD1 is appended ?


CONCATENATE itab_cod1-nume itab_cod1-prenume into itab_cod2-nume.
APPEND itab_cod1 to itab_cod2.   
* ?? itab_cod1-nume does not contain concatenated value 

Correct the Append and it should work.


APPEND itab_cod2.

Edited by: Suman Jagu on May 25, 2011 5:57 PM

0 Kudos

Yes...no logic there..you`re right.....I have corrected my mistake but it`s not working....now it doesn`t show any kind of name.

0 Kudos

Ok fine. Can you try with Data declaration for ITAB2 instead of types ( as in the example ), I m sure it is not able to get the fieldcatalog. Also check in debug if the itab_con2 is getting values.

0 Kudos

Feel soo foolish. The append was the problem.

Thank you so much for your help.