4 weeks ago
Hi Friends,
I tried to search but can't find an approach to this. Is there a way to add a text field, text label to a screen using a button or an icon from the tool bar (New items icon). Similar to transaction MB1A (2nd screen) where if I click on new items, it will add text fields on the screen (please see screenshot), adding 4th, 5th lines...
MB1A.jpg
Thank you.
Geoff
2 weeks ago
Hi Sandra
Actually it is MB1A that is obsolete (OSS note 2210569). Step loop is a bit dusty old technique, but I'm almost sure it is not totally obsolete.
I am still using step-loop for RF transactions running via webgui on android scanners. In this scenarios table control and ALV are not useful alternatives.
In general I agree that the functionality to dynamically add a line to a table on screen can also be made with table controls or ALV. The 3 options has each their own look and feel.
@jeff_broodwar if you want to use the same technique as MB1A, then you should search for ABAP step loop. You will find plenty of documentation online. Most of what you find will be around 20 years old, but it should still work.
I found Step-Loops in Module Pool Programming | PDF | Screenshot | Computer Science . This seems to explain it in a good way, but this site requires login.
There is also a little SAP standard documentation:
Step Loop
Creating a step loop in screen painter
Best Regards
Thomas Madsen Nielsen
Hi,
that’s a limitation of classic Dynpro. Screens are statically compiled, so you cannot really add new fields at runtime. What MB1A does is show more rows in a table control, not new fields. If you need truly dynamic behavior, you should look into SAPUI5 or Fiori where UI elements can be created or hidden based on user actions or data.
Cheers,
Sebastian
2 weeks ago
Thank you for the feedback. you mean to say MB1A has a certain number of fields already created and just makes them visible after clicking on New icon?
2 weeks ago
thank you for the joining, as described, similar behavior like MB1A's new fields being generated when New icon is clicked. Thanks.
2 weeks ago
You are repeating what you have said in your question, so your question is still imprecise.
If you mean generating new fields of any type anywhere in the screen, then the answer is no because generating a Dynpro screen is not recommended, especially when it's a standard screen.
For information, MB1A is using the obsolete technology Step Loop.
Instead of Step Loop, use Table Controls or editable ALV Grid. In all cases, you may add new rows as you wish. Adding new columns is possible dynamically, especially with ALV Grid.
2 weeks ago
Hi Sandra
Actually it is MB1A that is obsolete (OSS note 2210569). Step loop is a bit dusty old technique, but I'm almost sure it is not totally obsolete.
I am still using step-loop for RF transactions running via webgui on android scanners. In this scenarios table control and ALV are not useful alternatives.
In general I agree that the functionality to dynamically add a line to a table on screen can also be made with table controls or ALV. The 3 options has each their own look and feel.
@jeff_broodwar if you want to use the same technique as MB1A, then you should search for ABAP step loop. You will find plenty of documentation online. Most of what you find will be around 20 years old, but it should still work.
I found Step-Loops in Module Pool Programming | PDF | Screenshot | Computer Science . This seems to explain it in a good way, but this site requires login.
There is also a little SAP standard documentation:
Step Loop
Creating a step loop in screen painter
Best Regards
Thomas Madsen Nielsen
2 weeks ago
Sorry Sandra, I thought my question is clear, not sure how to describe it further. Furthermore, others were able to suggest or answer it. Anyway, thank you for your interest.
2 weeks ago
Good to know.
Probably you were simply asking how to add one row. What was missing in my answer is probably a link to the documentation of Step Loop then 😄
2 weeks ago - last edited 2 weeks ago
Hi Geoff, you can try also the following way:
Last time I checked this approach, it had several limitations and was not really convenient for my solution, although it could be suitable for some of your use cases.