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

Hide Statement

Former Member
0 Likes
466

Hi,

I'm not able to select the required data in the detail list. I am using the AT PF## event to display further data after displaying a list. I debugged the program and checked that i'm not getting the appropriate value in the field for which i used HIDE statement. I used this HIDE statement in a loop through which i'm displaying the basic list. By doing so the value for the last loop index is being retained for the HIDE field.My code is as follows;-

REPORT ZINT1.

TABLES : lfa1.

TYPES : BEGIN OF ty_lfa1,

lifnr TYPE lifnr,

land1 TYPE land1_gp,

name1 TYPE name1_gp,

ort01 TYPE ort01_gp,

END OF ty_lfa1,

BEGIN OF ty_t005,

land1 TYPE land1,

END OF ty_t005,

BEGIN OF ty_lfbk,

lifnr TYPE lifnr,

banks TYPE banks,

bankl TYPE bankl,

bankn TYPE bankn,

END OF ty_lfbk,

BEGIN OF ty_bsik,

lifnr TYPE lifnr,

belnr TYPE belnr_d,

bldat TYPE bldat,

budat TYPE budat,

dmbtr TYPE dmbtr,

END OF ty_bsik.

DATA : it_lfa1 TYPE STANDARD TABLE OF ty_lfa1,

wa_lfa1 TYPE ty_lfa1,

it_t005 TYPE STANDARD TABLE OF ty_t005,

wa_t005 TYPE ty_t005,

it_lfbk TYPE STANDARD TABLE OF ty_lfbk,

wa_lfbk TYPE ty_lfbk,

it_bsik TYPE STANDARD TABLE OF ty_bsik,

wa_bsik TYPE ty_bsik.

TOP-OF-PAGE.

WRITE : 'Vendor Name', 60 'Vendor ID',

/ 'Vendor City', 60 'Vendor Country'.

ULINE .

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr.

SELECTION-SCREEN END OF BLOCK b1.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE sy-ucomm.

WHEN 'PF14'.

WRITE : 'Vendor#',20 'Bank Country',40 'Bank Key',60 'Account No.'.

ULINE.

WHEN 'PF16'.

WRITE : 'Vend.No.', 20 'Document No.',40 'Doc.Date',

60 'Posting Date', 80 'Amount'.

ULINE.

ENDCASE.

START-OF-SELECTION.

SELECT lifnr land1 name1 ort01

FROM lfa1

INTO TABLE it_lfa1

WHERE lifnr IN s_lifnr.

IF sy-subrc = 0.

SELECT lifnr banks bankl bankn

FROM lfbk

INTO TABLE it_lfbk

FOR ALL ENTRIES IN it_lfa1

WHERE lifnr = it_lfa1-lifnr.

SELECT lifnr belnr bldat budat dmbtr

FROM bsik

INTO TABLE it_bsik

FOR ALL ENTRIES IN it_lfa1

WHERE lifnr = it_lfa1-lifnr.

ENDIF.

LOOP AT it_lfa1 INTO wa_lfa1.

WRITE : / wa_lfa1-name1, 60 wa_lfa1-lifnr,

/ wa_lfa1-ort01, 60 wa_lfa1-land1.

HIDE : wa_lfa1-lifnr.

ULINE.

ENDLOOP.

at PF14.

WINDOW STARTING AT 10 5

ENDING AT 85 30.

LOOP AT it_lfbk INTO wa_lfbk.

IF it_lfbk IS NOT INITIAL.

WRITE : wa_lfbk-lifnr, 20 wa_lfbk-banks, 40 wa_lfbk-bankl,

60 wa_lfbk-bankn.

else.

WRITE : 'No record Exists'.

ENDIF.

ENDLOOP.

at PF16.

WINDOW STARTING AT 10 5

ENDING AT 105 50.

LOOP AT it_bsik INTO wa_bsik.

IF it_bsik IS NOT INITIAL.

WRITE : / wa_bsik-lifnr, 20 wa_bsik-belnr, 40 wa_bsik-bldat,

60 wa_bsik-budat, 80 wa_bsik-dmbtr.

ELSE.

WRITE : 'No record exists'.

ENDIF.

ENDLOOP.

Here for e.g if i select values 100018 to 100020 on the selection screen for the field lfa1-lifnr, the value '100020' is retained for this field when i trigger the AT PF event and if i clear this field in the loop, no value is present for further selection.

How to resolve this issue?

Thanks in advance.

2 REPLIES 2
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
424

HIDE is used to get the values from say line-selection and only value will be used to traverse to secondary list.

In your case best solution is go for ALV.

Read only

Former Member
0 Likes
424

@Sandeep But it is mention as 'The user should be able to select either one of the lines for a vendor and invoke either of the AT PF events to create the further windows '.

How to do so?