‎2008 Jan 25 8:22 AM
Hi,
Can u anybody tell hoe to give function code for a text box in selection screen.?
Eg. when the user give the emp id his/her corresponding available telephone numbers should be displayed in Telephone Number field as F4 help....
Thanks in advance.
‎2008 Jan 25 8:44 AM
Hi Tharani,
Try this.
SELECTION-SCREEN BEGIN OF BLOCK b_0 WITH FRAME TITLE text-000.
PARAMETERS: s_text TYPE char450.
SELECTION-SCREEN END OF BLOCK b_0.
Also, pls chk this code.
Look at class cl_gui_textedit
(1) Screen
In dynpro create a custom container, call it 'INPUTBOX' or so
(2) In program top, declare
codeDATA: container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit.[/code]
(3) in PBO
if editor is initial.
CREATE OBJECT: container EXPORTING container_name = 'TEXTBOX',
editor EXPORTING parent = container
wordwrap_mode = 2
wordwrap_position = 80
wordwrap_to_linebreak_mode = 1.
CALL METHOD editor->set_text_as_r3table
EXPORTING table = texttab.
ENDIF.
(4) in PAI
read the text
codeIF NOT init IS INITIAL.
CALL METHOD editor->get_text_as_r3table
IMPORTING table = texttab.[/code]
exit and release
code CALL METHOD editor->free.
CALL METHOD container->free.
CLEAR: editor, container.
ENDIF.[/code]
Look at SAP Textedit.
kindly reward if found helpful.
cheers,
Hema.
‎2008 Jan 25 8:56 AM
we are fresher so plz tell alternative to solve it without using class. and we are doing report program not module pool.
‎2008 Jan 25 9:04 AM
YAAR DONT HAVE TO TAKE DAT MUCH PAIN TRY PARAMETERS AND U WILL GET A TEXT BOX IN WHICH U CAN ENTER VALUES.
YOU CAN ALSO TRY SELECT OPTIONS LIKE:
SELECT-OPTIONS : s_ebeln FOR ekko-ebeln .
PLZ REWARD IF USEFUL
REGARDS
VIVEK
‎2008 Jan 25 9:12 AM
hi..
as per above example the f4 help should not get all the telephone numbers available in database. the f4 should have the corresponding phone numbers of a emp typed in the previous textbox.
‎2008 Jan 25 9:00 AM
Hi,
Write the code as below in your report.
at selection-screen on field text_field.
if sy-subrc = 0.
endif.
Keep a break point on IF SY-SUBRC = 0 and execute the program.
When the program goes into debug mode, Check value of SY-UCOMM, this is the function code.
Regards,
Satish
‎2008 Jan 25 10:18 AM
Tharani,
We can get the F4 help if we use search helps.
Can you please be clear about your requirement.
Thanks,
Madhan.