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

User interaction button

Former Member
0 Likes
936

Hi Experts,

I have developed a function module and after running it , in the output screen i want to have user interaction by giving proceed button and if press the buttoon o/p of the FM should be downloaded.

To add the button in o/p screen i used the Screen statement AT USER COMMAND, AT LINE-SELECTION. But FM not access these screen statements.Then i created a screen 100 with PF Status, in that screen i have maintained the proceed button. Then i call this screen inside the FM. The screen is coming along with the proceed button. But the FM o/p not coming along this proceed button screen.

Please help out to have a button for user interaction in o/p of the FM.

Thanks.

Kelvin

9 REPLIES 9
Read only

Former Member
0 Likes
893

Hi Kelvin,

You have created a screen and then you have added the Proceed button in the screen. Later you have called the screen in the FM . When executing the FM you are able to see the proceed button but you are not able to download the data after that.

The solution is.

Move your data to a Global variable declared in the TOP INCLUDE of the function group of the FM. Now In the FM before calling screen move all the processed data in FM to that Global variable then in you PAI of the screen, under USER_COMMAND module, Check if the Proceed button is pressed. And if pressed Enter your LOGIC. Code sample given below.

Lets day the data you have to download is in internal table it_data.

Do as mentioned below.

1). In your top include.

DATA: it_data TYPE STANDARD TABLE OF ty_data.

2). In your FM.

it_final is the table in FM which has your processed data and this is also of same structure ty_data.

it_data[] = it_final[].  " moving all the data to global variable.
CALL SCREEN 100.

3). in the PAI of screen 100.

MODULE USER_COMMAND INPUT.
CASE sy-ucomm.
WHEN 'PROCEED'.
 <logic to download the it_data table>
ENDCASE.
ENDMODULE.

Thus your requirement can be achieved by moving the data to a global variable then downloading it using user interaction button.

Please do let me know for more details.

Regards,

Praveenkumar T.

Read only

0 Likes
893

Hi Praveen,

While executing FM it's giving an empty output screen with proceed button , but i want to have output internal table values along with the proceed button screen. How to get the internal table values to the o/p screen. Also is it possible to get drop down value for FM input parameter?

Thanks

Read only

0 Likes
893

Hi,

Why are you doing this in a FM?

You can crate a report also for the same...everything will be simplified.

And if you particularly want to use FM only, then create report with all the logic and then in Fm, just use SUBMIT to execute that report.

In report, you can add button also..and have listbox as well.

Regards,

Harsh Bansal

Read only

Former Member
0 Likes
893

Hi Kelvin,

To view the output of the FM in your screen. as mentioned in my previous reply move it to global variable. Now your screen field (table control) should refer to the work area of this global variable. This will make sure that all the data in the global variable is displayed in your screen.

Hope this helps.

Regards,

Praveenkumar T.

Read only

0 Likes
893

Hi Praveen,

while executing it gives error that screen 100 doesnt exits. This Call Screen 100 statment is not executing . IHave to give the screen program name some where and how..Please help me.

Thanks

Read only

0 Likes
893

Hi ,

Create screen in that program only.

May be you are trying to create from Screen Painter.

And also you should call screen like CALL SCREEN 0100 not 100.

Regards,

Harsh Bansal

Read only

0 Likes
893

Hi Kelvin,

You have to add the screen in the same function group. If you have added in the same function group activate it again and try.

If the screen is in different function group then it will not help.

Please let me know if you face any more issues.

Regards,

Praveenkumar T.

Read only

Former Member
0 Likes
893

as far i can see Function modules are meant for user who gives some input parameters and consequently gets value or interface )like grid) based on input parameters.

u cannot design a pushbutton is FM.

Read only

Former Member
0 Likes
893

Solved