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

get record during interactive report

Former Member
0 Likes
547

Hello friends,

I created an interactive report using tables PA0002, PA0006,PA0008,PA0037.

During SY-LSIND = 2 I try to get the insurance detail for particular employee.

At top-of-page I gave "Insurance details for employee", emp-name. Next I get the insurance detail of the employee.

If the employee is not insured Then what I want is that on top-of-page "Insurance detail of employee", emp-name and I must get the line "employee", emp-name, " not insured'.

Iam getting the record if the employee is insured and if employee is not insured what i get is "Insurance detail for employee", (Here I am getting blank) and at bottom "employee", (Once again blank), "not insured".

****

****

ELSEIF SY-LSIND = 2.

WRITE 😕 'INSURANCE DETAIL FOR EMPLOYEE', 40 ETAB-NACHN COLOR 5,85

'PAGE NUMBER', 98 SY-PAGNO.

WRITE 😕 SY-ULINE.

WRITE :/(1) SY-VLINE,

(18) ' EMPLOYEE NO',

(1) SY-VLINE,

(20) 'EMPLOYEE NAME',

(1) SY-VLINE,

(20) 'INSURANCE COMPANY',

(1) SY-VLINE,

(20) 'INSURANCE TYPE',

(1) SY-VLINE,

(20) 'AMOUNT INSURED',

(1) SY-VLINE.

WRITE 😕 SY-ULINE.

ENDIF.

END-OF-PAGE.

WRITE 😕 SY-ULINE.

AT LINE-SELECTION.

******

******

ELSEIF SY-LSIND = 2.

NEW-PAGE LINE-SIZE 114.

SELECT PA0002~PERNR

PA0002~NACHN

PA0037~VSGES

PA0037~VSART

PA0037~VSSUM

INTO ETAB

FROM PA0002

INNER JOIN PA0037

ON PA0002PERNR = PA0037PERNR

WHERE PA0002~PERNR = ITAB-PERNR.

APPEND ETAB.

ENDSELECT.

LOOP AT ETAB.

WRITE :/(1) SY-VLINE,

(18) ETAB-PERNR,

(1) SY-VLINE,

(20) ETAB-NACHN,

(1) SY-VLINE,

(20) ETAB-VSGES,

(1) SY-VLINE,

(20) ETAB-VSART,

(1) SY-VLINE,

(20) ETAB-VSSUM,

(1) SY-VLINE.

ENDLOOP.

WRITE 😕 SY-ULINE.

SKIP 2.

WRITE 😕 'END OF INSURANCE DETAIL' .

ENDIF.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
516

Hai SK,

In the event TOP OF PAGE DURING LINE SELECTION write the code.

If sy-lsind = 1.

Write 😕 u2018 < ur Heading> u2018.

elseIf sy-lsind = 2.

If <check the condition that the person is not insured>.

Write 😕 u2018Person not insuredu2019.

Else.

Write 😕 u2018Person Insuredu2019.

Endif.

.

.

.

.

Endif.

Reward if found useful,

Regards,

Swapna.

4 REPLIES 4
Read only

Former Member
0 Likes
517

Hai SK,

In the event TOP OF PAGE DURING LINE SELECTION write the code.

If sy-lsind = 1.

Write 😕 u2018 < ur Heading> u2018.

elseIf sy-lsind = 2.

If <check the condition that the person is not insured>.

Write 😕 u2018Person not insuredu2019.

Else.

Write 😕 u2018Person Insuredu2019.

Endif.

.

.

.

.

Endif.

Reward if found useful,

Regards,

Swapna.

Read only

0 Likes
516

Thank you NagaSwapna to solve my problem.

Read only

venkat_o
Active Contributor
0 Likes
516

Hi SK, something wrong with the below select query

SELECT PA0002~PERNR
PA0002~NACHN
PA0037~VSGES
PA0037~VSART
PA0037~VSSUM
INTO ETAB
FROM PA0002
INNER JOIN PA0037
ON PA0002~PERNR = PA0037~PERNR
WHERE PA0002~PERNR = ITAB-PERNR.

APPEND ETAB.
ENDSELECT.
"here where itab-pernr from  in the where condition.
Thanks, Venkat.O

Read only

Former Member
0 Likes
516

In the basic list I use HIDE ITAB-PERNR. According to that i.e if I click over one particular employee I got the records from table PA0008 and on further selection I want to display the insurance detail of that particular employee that is from HIDE ITAB-PERNR from the basic list.

my code worked if the employee is insured.