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

Dynamic fields in Dialog Program

Former Member
0 Likes
560

Dear Experts,

In my code, say in a Function module am calling a screen with some co-ordinates.

There would be only one field on the screen.based on my coding, the field on the screeen should change.

i man the field display text and the length. Any idea on this?

Regards,

kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
504

Hi Sampath,

Check the below code snippet

Instead of creating your own Screen use the below FM

PARAMETERS : abc TYPE char40. " Just copy this and Execute
DATA : str1 TYPE string, str2 TYPE string. " If you dont have parameter then pass your 
" Table name in place of STR1 and Field name in place of STR2 in the below code
TRANSLATE abc TO UPPER CASE.

SPLIT abc AT '-' INTO str1 str2. " If you know only Field and name and dont know table name then
" select single * from DD03L where fieldname = 'YOUR_FIELDNAME'  and keyflag = 'X'.
Now pass the Table name in the STR1

DATA : fields TYPE STANDARD TABLE OF sval WITH HEADER LINE.
REFRESH fields.
fields-tabname = str1.
fields-fieldname = str2.
fields-field_obl = 'X'.
APPEND fields.
CALL FUNCTION 'POPUP_GET_VALUES'
  EXPORTING
*   NO_VALUE_CHECK        = ' '
    popup_title           = 'Give your Title'
*   START_COLUMN          = '5'
*   START_ROW             = '5'
* IMPORTING
*   RETURNCODE            = RETURNCODE
  TABLES
    fields                = fields
* EXCEPTIONS
*   ERROR_IN_FIELDS       = 1
*   OTHERS                = 2

Cheerz

Ram

3 REPLIES 3
Read only

Former Member
0 Likes
504

Hi..

can u explain better your issue pls?

regards

Marco

Read only

0 Likes
504

Hey Hi,

Am sorry for the late reply.

Requirement: in my code i call a screen 100..call screen at some xxx yyy co-ordinates

my field that has to appear on the screen 100 for input changes dynamically..

i have written a select statement and supposedly it results MATNR once and BELNR once in lv_field.

i have to display Material once on the screen and next time when the code gets executed BELNR.

These are jus examples. Any field may come up , but that has t be displayed on the screen 100 allowing user for input.

Please help me to achieve this.

Read only

Former Member
0 Likes
505

Hi Sampath,

Check the below code snippet

Instead of creating your own Screen use the below FM

PARAMETERS : abc TYPE char40. " Just copy this and Execute
DATA : str1 TYPE string, str2 TYPE string. " If you dont have parameter then pass your 
" Table name in place of STR1 and Field name in place of STR2 in the below code
TRANSLATE abc TO UPPER CASE.

SPLIT abc AT '-' INTO str1 str2. " If you know only Field and name and dont know table name then
" select single * from DD03L where fieldname = 'YOUR_FIELDNAME'  and keyflag = 'X'.
Now pass the Table name in the STR1

DATA : fields TYPE STANDARD TABLE OF sval WITH HEADER LINE.
REFRESH fields.
fields-tabname = str1.
fields-fieldname = str2.
fields-field_obl = 'X'.
APPEND fields.
CALL FUNCTION 'POPUP_GET_VALUES'
  EXPORTING
*   NO_VALUE_CHECK        = ' '
    popup_title           = 'Give your Title'
*   START_COLUMN          = '5'
*   START_ROW             = '5'
* IMPORTING
*   RETURNCODE            = RETURNCODE
  TABLES
    fields                = fields
* EXCEPTIONS
*   ERROR_IN_FIELDS       = 1
*   OTHERS                = 2

Cheerz

Ram