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

Disp. Data dynamically based on fields and its value defined in int. table.

Former Member
0 Likes
802

I need to display data in a internal table for editing in a screen.

you have a internal table with field name , data types and its value. I need to display data in a screen ( sceen painter not in a report) row by row in vrtical format.

The internal table's structure not fix. you can have any number of fields in the internal table.

Can you please send me code if it is available with you or send me any senario in SAP if any ...so that i can debug to extract the code..

have to display data vertically as below in editable format,

for example,

Airline

Flight Number

Flight date

Flight price

Airline Currency

Plane Type

Maximum capacity

Occupied econ.

Total

No of fields will change.

also F4 help needs to be attached with each field.

I think it can be done through step loop. can anybody give sample code or tell me where to find in SAP or somewhere else?

it will be great help to me..

Sanjeev

6 REPLIES 6
Read only

Former Member
0 Likes
762

Hi,

Try using POPUP_GET_VALUES FM..

Thanks,

Naren

Read only

0 Likes
762

Hi Naren,

Thanks for your quick response,but this solution won't work because i need to display data on lower half of the screen and fields are not related to any table. Also, I need to attached F4 help for which i will create values in the program.

Please let me know if it can be done using step loop. Can you give me sample code for the same?

Regards,

Sanjeev

Read only

Former Member
0 Likes
762

Hi,

Check this sample code..

DATA: t_val LIKE sval OCCURS 0 WITH HEADER LINE.

DATA: v_returncode TYPE c.

t_val-fieldname = 'MATNR'.

t_val-tabname = 'MARA'.

t_val-field_obl = 'X'.

APPEND t_val.

CLEAR t_val.

t_val-fieldname = 'WERKS'.

t_val-tabname = 'MARC'.

APPEND t_val.

CLEAR t_val.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

no_value_check = 'X'

popup_title = 'Test '

START_COLUMN = '0'

START_ROW = '0'

IMPORTING

returncode = v_returncode

TABLES

fields = t_val

EXCEPTIONS

error_in_fields = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT t_val.

IF t_val-fieldname = 'MATNR'.

WRITE: / 'Material', t_val-value.

ELSEIF t_val-fieldname = 'WERKS'.

WRITE: / 'Plant', t_val-value.

ENDIF.

ENDLOOP.

THanks,

Naren

Read only

0 Likes
762

Yes this really helped me. How to give points? Please let me know.

thanks a lot!

Sanjeev

Read only

Former Member
0 Likes
762

Hi,

Do you want to display the data like this

Material _________

Werks _____

OR Like

Material Werks

________ ______

Meaning can the user enter multiple rows.

Thanks,

Naren

Read only

0 Likes
762

I need to display data vertically like this as oyu have mentioned,

Material _________

Werks _____

data can be in multiple row. For that I need to gives buttons to move back and forth.

But only one record will be displayed at one time.

Regards,

Sanjeev