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

How to control control parameters dynamically ?

Former Member
0 Likes
1,264

Hello ,

I'm working on project that performs parameters and buttons at SELECTION-SCREEN and also when someone creates entry to that application it will save those information into the database (this part is already done).My issue is i have no idea how to control those entries dynamically . I mean code suppose to takes 10 entries with parameters then write it.

Thank You.

1 ACCEPTED SOLUTION
Read only

VijayaKrishnaG
Active Contributor
0 Likes
1,214

Hi Zati,

As of my understanding, in a parameter user will enter 10 different entries by pressing 'Enter' after each entry. All those entries has to be handled or write.

Is this your requirement? If not and my understanding was wrong, please ignore and can you please elaborate your query a bit.

Regards,

Vijay

6 REPLIES 6
Read only

VijayaKrishnaG
Active Contributor
0 Likes
1,215

Hi Zati,

As of my understanding, in a parameter user will enter 10 different entries by pressing 'Enter' after each entry. All those entries has to be handled or write.

Is this your requirement? If not and my understanding was wrong, please ignore and can you please elaborate your query a bit.

Regards,

Vijay

Read only

former_member183073
Active Participant
0 Likes
1,214

can you explain a bit more?

Read only

Former Member
0 Likes
1,214

Hi VIJAYKRISHNA and Syed,

First of all sorry for my lack of description . As a second part my current code works with buttons as :

Create/Delete/Change/Display/Clean


As you might guess the functions of first four they do changes on entry and last one is only cleaning parameters.


And here my code :

AT SELECTION-SCREEN.
   CASE sy-ucomm.
     WHEN 'CREATE'.
       DO 10 TIMES.
gs_itab-VEN_ID = id.
gs_itab-VEN_NAME = isim.
gs_itab-VEN_SNAME = soyad.
gs_itab-VEN_PHONE = tel.
gs_itab-VEN_MAIL = mail.
  INSERT INTO  zsp940_t_002 VALUES gs_itab.
  ENDDO.
  WRITE : / id,isim,soyad,tel,mail.
     WHEN 'CHANGE'.
  UPDATE zsp940_t_002
  SET VEN_ID = id VEN_NAME = isim VEN_SNAME = soyad VEN_PHONE = tel
  VEN_MAIL = mail
  WHERE VEN_ID = id.
  WHEN 'DELETE'.
    DELETE FROM zsp940_t_002 WHERE VEN_ID = id.
     WHEN 'DISPLAY'.
SELECT * FROM zsp940_t_002 INTO TABLE gt_itab WHERE ven_id = id.
LOOP AT gt_itab INTO gs_itab.
isim = gs_itab-VEN_NAME.
soyad = gs_itab-VEN_SNAME.
tel = gs_itab-VEN_PHONE.
mail = gs_itab-VEN_MAIL.
ENDLOOP.
WHEN 'CLEAN'.
id = ' '.
isim = ' '.
soyad = ' '.
tel = ' '.
mail = ' '.

   ENDCASE.


Im trying to make Create button works only 10 times then my code will show those 10 entries

with WRITE function.

Thank you for your replies.

Read only

0 Likes
1,214

Hi,

     WHEN 'CREATE'.
       DO 10 TIMES.
gs_itab-VEN_ID = id.
gs_itab-VEN_NAME = isim.
gs_itab-VEN_SNAME = soyad.
gs_itab-VEN_PHONE = tel.
gs_itab-VEN_MAIL = mail.
  INSERT INTO  zsp940_t_002 VALUES gs_itab.
  ENDDO.
WRITE : / id,isim,soyad,tel,mail.

From your code and description I understood that 'Create' button has to work and enable the input for 10 times. And you want to display all those input values.

If that is the requirement, you need not to loop for 10 times, Keep the count increasing everytime with a variable.

WHEN 'CREATE'.    

     IF L_COUNT <= 10.

     gs_itab-VEN_ID = id.
     gs_itab-VEN_NAME = isim.
     gs_itab-VEN_SNAME = soyad.
     gs_itab-VEN_PHONE = tel.
     gs_itab-VEN_MAIL = mail.
    

     INSERT INTO  zsp940_t_002 VALUES gs_itab.


     L_COUNT = L_COUNT + 1.

     ENDIF.

Note: WRITE statement in AT SELECTION-SCREEN, AT SELECTION-SCREEN OUTPUT will not be triggered, I mean system cannot write data on SELECTION SCREEN we cannot see the Written data.

If still my understanding was wrong, please explain your requirement more clear from begginging.

Regards,

Vijay

Read only

Former Member
0 Likes
1,214

Hi Vijay,

Thank you for your precious comments you helped me for making my code work partly and now i need to do this condition i need to implement leaving selection to case statement.I've looked for it but still something missing.

Read only

0 Likes
1,214

Anay, I did not understand what you required now. I think after 10 inputs you need to block the input parameter, Right???

If that is the case, try below code. If not please explain a bit detailed.

WHEN 'CREATE'.   

     IF L_COUNT <= 10.

     gs_itab-VEN_ID = id.
     gs_itab-VEN_NAME = isim.
     gs_itab-VEN_SNAME = soyad.
     gs_itab-VEN_PHONE = tel.
     gs_itab-VEN_MAIL = mail.
   

     INSERT INTO  zsp940_t_002 VALUES gs_itab.


     L_COUNT = L_COUNT + 1.

     

     ELSE.

          LOOP AT SCREEN.

               IF SCREEN-NAME = '<parameter_name>'.

               SCREEN-INPUT = 0.

               MODIFY SCREEN.

               ENDIF.

          ENDLOOP.

     ENDIF.

Regards,

Vijay