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

Require select-option functionality in Module Pool Programming

Former Member
0 Likes
1,844

Hi Gurus,

I am doing a development by Module Pool on Warehouse Management. For that development user require select-option on

screen for entering multiple storage type.

My first question : Is any thing available for directly implement select-option by module pool ?

My Second Question : I have use two text boxes for range and one button for multiple selection and arrange on screen like select-option. then on PAI of that button I call COMPLEX_SELECTIONS_DIALOG FM. Now it is working fine. Now I put some value in it. when I save the values and exit , I want the icon of the button must change from icon_enter_more to icon_display_more. I write the below code for that in PBO of the screen:

if rtab[] is initial. "RTAB[] is a table for holding values what inputted in popup of multiple selection.

write icon_enter_more as icon to button. " BUTTON is screen field and it taken as a type C length 4 on TOP module as .

else. " BUTTON taken on screen as push button.

write icon_display_more as icon to button.

endif.

but the icon is not changing dynamically.

If I use ICON_CREATE then one short dump happen describing OUTPUTLEN_TOO_SMALL.

Can anybody please give me the solution.

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,786

Hi,

Refer this wiki by me:

Use the functionality of select-options in dialog programming (module pool)

https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=117506109

Hope this helps you.

Let me know if you need some other info.

Regards,

Tarun

17 REPLIES 17
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,787

Hi,

Refer this wiki by me:

Use the functionality of select-options in dialog programming (module pool)

https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=117506109

Hope this helps you.

Let me know if you need some other info.

Regards,

Tarun

Read only

Former Member
0 Likes
1,786

Hi Tarun,

Thank you for your quick reply.

Yes , I did my coding same as it is refer in the link. Upto that it is working fine. No issues are there.

But my problem is to change the icon of the pushbutton dynamically. When there is some value exist in range then

the icon should be appear as green(ICON_DISPLAY_MORE). But in my case I am not able to change it from program.

I have specified the code segment I used for it. Please clarify on that, otherwise the function module is working properly.

Please give some more clarification on dynamic icon change.

Your given link is accurate but my problem is something further.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,786

Hi,

Refer the wiki by me:

Change an Icon of a Button Dynamically In Module Pool

https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=116982420

Hope this helps you.

Regards,

Tarun

Read only

0 Likes
1,786

link:[Change button icon dynamically in module pool|https://wiki.sdn.sap.com/wiki/display/sandbox/ChangeanIconofaButtonDynamicallyInModule+Pool]

Read only

Former Member
0 Likes
1,786

Hi Tarun & Keshu,

Same code I have already applied but there is no effect.

Thank you.

Read only

0 Likes
1,786

Did you debug your code.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,786

Hi,

Can you paste your code here and let me know your exact problem.

Waiting for your reply.

Regards,

Tarun

Read only

Former Member
0 Likes
1,786

IN PBO SECTION.

module STATUS_0001 output.

SET PF-STATUS 'ZINVGUI'.

SET TITLEBAR 'ZIN'.

if rbtn1 = 'X'.

loop at screen.

if screen-group1 = 'GR2'.

screen-input = 0.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-group1 = 'GR1'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

IF RTAB[] IS INITIAL.

WRITE icon_enter_more AS ICON TO GTTYP.

else.

WRITE icon_display_more AS ICON TO GTTYP.

endif.

endmodule.

IN PAI

form GET_STORAGE_TYPE .

TAB_FIELD-FIELDNAME = 'LGTYP'.

TAB_FIELD-TABLENAME = 'LQUA'.

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'

EXPORTING

TITLE = ' '

TEXT = 'Storage Types'

  • SIGNED = 'X'

  • LOWER_CASE = ' '

  • NO_INTERVAL_CHECK = ' '

  • JUST_DISPLAY = ' '

  • JUST_INCL = ' '

  • EXCLUDED_OPTIONS =

  • DESCRIPTION =

  • HELP_FIELD =

  • SEARCH_HELP =

TAB_AND_FIELD = TAB_FIELD

TABLES

range = RTAB

EXCEPTIONS

NO_RANGE_TAB = 1

CANCELLED = 2

INTERNAL_ERROR = 3

INVALID_FIELDNAME = 4

OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

DATA:LAST TYPE SY-TABIX.

DESCRIBE TABLE RTAB LINES LAST.

IF NOT rTAB[] IS INITIAL.

  • Read the very first entry of the range table and pass it to

  • dynpro screen field

READ TABLE rTAB INDEX 1.

IF sy-subrc = 0.

P_LGTYP1 = rTAB-low.

ENDIF.

READ TABLE RTAB INDEX LAST.

IF sy-subrc = 0.

P_LGTYP1U = rTAB-LOW.

ENDIF.

ELSE.

rTAB-low = p_lgtyp1.

append rtab.

rTAB-low = p_lgtyp1u.

append rtab.

ENDIF.

endform.

IN TOP INCLUDE.

DATA : GTTYP TYPE C length 4.

Read only

Former Member
0 Likes
1,786

waiting for reply.

Read only

0 Likes
1,786

Did you debug your code and check RTAB[]. Guess it failing and its always initial.

Read only

Former Member
0 Likes
1,786

Hi keshu,

Yes I did debug and if block is working properly as the rtab[] get populated, no issue in condition block.

Infact both of this write statement gets executed depending on condition , but in screen it does not give any effect.

What could be the reason for it.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,786

Hi,

Yes, I am also confused that there is no effect at my end as well.

Still I am looking into it. Will update you once rectified.

Regards,

Tarun

Read only

Former Member
0 Likes
1,786

Hi Tarun,

I am also confused like you. Means I am not able to find the exact reason behind it , and still looking for solution.

If I get any solution then I will update it immediately.

Thank you Tarun and Keshu for all your responses and cooperation.

Hope this problem will be solved soon. Please keep continue your valuable responses.

Edited by: CONTACTSANKU on Oct 21, 2009 3:19 PM

Read only

0 Likes
1,786

Hi check this

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,786

Hi,

Is it done??

Regards,

Tarun

Read only

Former Member
0 Likes
1,786

Hi Keshu,

The PUSHBUTTON should be for OUTPUT and the OUTPUT check box should be checked. This actually solve the problem.

This link is really helpful.

Thanks for you reply

Read only

Former Member
0 Likes
1,786

It is done. Just check the output check box of your pushbutton. and check your coding.

But what is the exact reason and why it should be checked in this case is still unknown.