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: 

Reg: how to change the programm Urgent

Former Member
0 Kudos

HI Gurus,

I created this programm. i want to add follwing fields in following programm :

&----


*& Report Z2GFR_TEST798 *

*& *

&----


*& *

*& *

&----


REPORT Z2GFR_TEST798 NO STANDARD PAGE HEADING.

tables: bkpf.

DATA: BEGIN OF itab OCCURS 0,

bukrs TYPE bkpf-bukrs,

belnr TYPE bkpf-belnr,

gjahr TYPE bkpf-gjahr,

END OF itab.

DATA: wa TYPE SRGBTBREL,

bdate TYPE bkpf-budat,

btime TYPE sy-uzeit,

tzone TYPE ttzz-tzone value 'UTC+1'.

data: g_instance like SRGBTBREL-INSTID_A.

SELECT-OPTIONS: bukrs FOR bkpf-bukrs OBLIGATORY,

belnr FOR bkpf-belnr OBLIGATORY,

gjahr FOR bkpf-gjahr OBLIGATORY DEFAULT sy-datum(4).

*

START-OF-SELECTION.

SELECT bukrs belnr gjahr FROM bkpf INTO TABLE itab

WHERE bukrs IN bukrs

AND belnr IN belnr

AND gjahr IN gjahr.

IF sy-subrc <> 0.

MESSAGE e001(00) WITH 'no data found!'.

ENDIF.

LOOP AT itab.

CLEAR wa.

  • SELECT SINGLE * FROM sgoshist INTO wa

  • WHERE objkey = itab

  • AND objtype = 'BKPF'.

concatenate itab-bukrs itab-belnr itab-gjahr into g_instance.

select single * from SRGBTBREL into wa

where INSTID_A = g_instance.

FORMAT COLOR 4 ON.

WRITE : / itab-bukrs, itab-belnr, itab-gjahr.

HIDE itab.

FORMAT COLOR 2 ON.

IF sy-subrc = 0.

CONVERT TIME STAMP wa-UTCTIME

TIME ZONE tzone

INTO DATE bdate TIME btime.

WRITE : 'Contains Attachment', bdate, btime.

ELSE.

FORMAT INTENSIFIED OFF.

WRITE: 'no attachment' .

FORMAT INTENSIFIED ON.

ENDIF.

ENDLOOP.

TOP-OF-PAGE.

FORMAT COLOR 1 ON.

WRITE: /'Comp', 'Doc-number', 'Year', 'user ',

'att.-date', ' time'.

ULINE.

FORMAT COLOR 1 OFF.

AT LINE-SELECTION.

SET PARAMETER ID 'BUK' FIELD itab-bukrs.

SET PARAMETER ID 'BLN' FIELD itab-belnr.

SET PARAMETER ID 'GJR' FIELD itab-gjahr.

CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.

user needs following fields:

<b><u>Screen</u></b>

Screen Heading

Company Code:

Fiscal Year:

Document No:

Report:

Doc Date:

Doc No:

amount:

Status

User Name:

Doc Type:

Doc Size

How to do it plz help me

regards

JK Rao

2 REPLIES 2

Former Member
0 Kudos

hi

good

if you want to add these fields in the output screen than you can do it using the selection screen .

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/content.htm

thanks

mrutyun^

Former Member
0 Kudos
SELECT-OPTIONS: bukrs FOR bkpf-bukrs OBLIGATORY,
gjahr FOR bkpf-gjahr OBLIGATORY DEFAULT sy-datum(4),
belnr FOR bkpf-belnr OBLIGATORY.

LOOP AT itab.

CLEAR wa.

concatenate itab-bukrs itab-belnr itab-gjahr into g_instance.

select single * from SRGBTBREL into wa
where INSTID_A = g_instance.

FORMAT COLOR 4 ON.
WRITE : / itab-bukrs, itab-belnr, itab-gjahr.

Add the other firlds here for display.

HIDE itab.
FORMAT COLOR 2 ON.

IF sy-subrc = 0.

CONVERT TIME STAMP wa-UTCTIME
TIME ZONE tzone
INTO DATE bdate TIME btime.

WRITE : 'Contains Attachment', bdate, btime.

ELSE.
FORMAT INTENSIFIED OFF.
WRITE: 'no attachment' .
FORMAT INTENSIFIED ON.
ENDIF.

ENDLOOP.


TOP-OF-PAGE.
FORMAT COLOR 1 ON.
WRITE: /'Comp', 'Doc-number', 'Year', 'user ',
'att.-date', ' time'.
ULINE.
FORMAT COLOR 1 OFF.

<b>WRITE:/ 'Doc Date:',

/ 'Doc No:',

/ 'amount:',

/ 'Status:',

/ 'User Name:',

/ 'Doc Type:',

/ 'Doc Size:'.

If u want it in the same llien specify the position instead of /. </b>

[code]

AT LINE-SELECTION.

SET PARAMETER ID 'BUK' FIELD itab-bukrs.

SET PARAMETER ID 'BLN' FIELD itab-belnr.

SET PARAMETER ID 'GJR' FIELD itab-gjahr.

CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.[code]

Only the order has changed for selection screen.

First make the itab with the additional fields adn retrieve the same from the tabel.

Message was edited by:

Judith Jessie Selvi