Application Development 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: 

Screen field ouput problem

Former Member
0 Kudos

Hi Experts,

Is there any way to display for example customer name on the right of a customer code select option in a report? Is just the same like in screen, when we define an input field for customer code and one output field to display the customer name based on what he or she enters.

I am doing this way but got stuck:


SELECTION-SCREEN BEGIN OF BLOCK r01 WITH FRAME TITLE text-003. 
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT (28) FOR FIELD cust.
SELECT-OPTIONS: cust FOR kna1-kunnr NO INTERVALS NO-EXTENSION.    <--------the customer code
SELECTION-SCREEN POSITION 48.
PARAMETERS: name LIKE kna1-name1.               <--------the customer name
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK r01.

How can i show the customer name field as output only?

I have used screen-output = 1, but the layout is not the same when we choose it from the screen field properties --> output only.

Please advise.

Thanks

Edited by: starry99 on Nov 3, 2009 4:59 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try using screen-input = 0 in the AT SELECTION-SCREEN OUTPUT event for the required field.

Regards,

Nilesh.

7 REPLIES 7

Former Member
0 Kudos

Hi,

Try using screen-input = 0 in the AT SELECTION-SCREEN OUTPUT event for the required field.

Regards,

Nilesh.

awin_prabhu
Active Contributor
0 Kudos

Hi Starry,

Add below code in under event 'At selection-screen output'.

LOOP AT SCREEN.

IF screen-name = 'NAME'. " Ur customer name field

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Thanks,

awin_prabhu
Active Contributor
0 Kudos

Thanks,

Edited by: Sap Fan on Nov 4, 2009 5:03 AM

venkat_o
Active Contributor
0 Kudos

Hi, <li>Try this. It works.


REPORT ztest_program.
DATA: BEGIN OF it_kna1 OCCURS 0,
        kunnr TYPE kna1-kunnr,
        name1 TYPE kna1-name1,
      END OF it_kna1.
DATA:
    i_return_tab  TYPE STANDARD TABLE OF ddshretval,
    w_return_tab  TYPE ddshretval.
DATA:w_dynpfields TYPE dynpread,
    i_dynpfields LIKE STANDARD TABLE OF dynpread.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
TABLES kna1.
SELECTION-SCREEN BEGIN OF BLOCK r01 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT (28) FOR FIELD cust.
SELECT-OPTIONS: cust FOR kna1-kunnr NO INTERVALS NO-EXTENSION. "   <--------the customer code
SELECTION-SCREEN POSITION 48.
PARAMETERS: name1 LIKE kna1-name1.              " <--------the customer name
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK r01.
SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'NAME1'.
      screen-input = '0'.
      screen-output = '1'.
      screen-display_3d = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
"F4 Help for Werks

AT SELECTION-SCREEN ON VALUE-REQUEST FOR cust-low.
  IF it_kna1[] IS INITIAL.
    SELECT kunnr name1
    FROM kna1
    INTO TABLE it_kna1.
  ENDIF.
  "Function module for F4 help
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'KUNNR'   "field name on f4 help window
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'CUST-LOW' "Screen field name
      value_org   = 'S'
    TABLES
      value_tab   = it_kna1
      return_tab  = i_return_tab.
  READ TABLE i_return_tab INTO w_return_tab INDEX 1.
  cust-low = w_return_tab-fieldval.
  READ TABLE it_kna1 WITH KEY kunnr = cust-low.
  IF sy-subrc = 0.
    w_dynpfields-fieldname    = 'NAME1'.
    w_dynpfields-fieldvalue   = it_kna1-name1.
    APPEND w_dynpfields TO i_dynpfields.
    CLEAR w_dynpfields.
    "DYNP_VALUES_UPDATE
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname     = sy-repid
        dynumb     = sy-dynnr
      TABLES
        dynpfields = i_dynpfields.
  ENDIF.
Thanks Venkat.O

Former Member
0 Kudos

Hi All,

Thanks for the replies. I have solved it.

Thanks to Venkat.

By the way, i have one more doubts. When i use the function F4IF_INT_TABLE_VALUE_REQUEST, can i design my own search help fields? For example, i have the customized customer search help with code and name. Can i include one more field for maximum hits to allow user to enter?

Regards

0 Kudos

Hi Starry,

See below thread,

Thanks,

former_member187457
Active Contributor
0 Kudos

try to use like this...

PARAMETERS: matnr type matnr,

text type maktx.

at SELECTION-SCREEN OUTPUT.

if matnr is not initial.

select single maktx

from makt

into text

where matnr eq matnr.

endif.