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

call transaction

Former Member
0 Likes
2,762

hi to all,

i have two fields <b>SALES ORDER</b> AND <b>BILLING DOCUME</b>NT .. I want to double click on these two in my report/....but it not properly executing...can u suggest me if it is correct or not....

data....

data : begin of wa occurs 0,

vbeln type vbap-vbeln,

vbel1 type vbrp-vbeln,

data :end of wa.

data : itab like table of wa WITH HEADER LINE.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-fieldname = 'VBELN'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

SET PARAMETER ID 'AUN' FIELD wa-vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

ENDIF.

IF rs_selfield-fieldname = 'VBELN'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

SET PARAMETER ID 'VF' FIELD wa-vbeln.

CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.

ENDIF.

thanks,

raju

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,543

Hi,

Second one should be :

IF rs_selfield-fieldname = 'VBEL1'.
READ TABLE itab INTO wa INDEX rs_selfield-tabindex.
SET PARAMETER ID 'VF' FIELD wa-vbel1.
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
ENDIF.

regards,

Erwan.

hi to all,

i have two fields <b>SALES ORDER</b> AND <b>BILLING DOCUME</b>NT .. I want to double click on these two in my report/....but it not properly executing...can u suggest me if it is correct or not....

data....

data : begin of wa occurs 0,

vbeln type vbap-vbeln,

vbel1 type vbrp-vbeln,

data :end of wa.

data : itab like table of wa WITH HEADER LINE.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-fieldname = 'VBELN'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

SET PARAMETER ID 'AUN' FIELD wa-vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

ENDIF.

IF rs_selfield-fieldname = 'VBELN'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

SET PARAMETER ID 'VF' FIELD wa-vbeln.

CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.

ENDIF.

thanks,

raju

16 REPLIES 16
Read only

Former Member
0 Likes
2,543

Hi,

Have u enabled the user_command parameer in FM

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                =
*   I_BUFFER_ACTIVE                   = ' '
     i_callback_program                = v_repid
     i_callback_pf_status_set    = 'SET_PF_STATUS'
<b> i_callback_user_command     = 'USER_COMMAND'</b>
     i_background_id        = 'ALV_BACKGROUND'
    IS_LAYOUT               = I_LAYOUT
    it_fieldcat             = i_fieldcat "field catalog
   I_SAVE                   = 'A'
   IS_VARIANT               = G_VARIANT
    TABLES
        t_outtab      = i_output "output table
   EXCEPTIONS
     program_error                     = 1
     OTHERS                            = 2
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

If u havent done do so.

Then in the form


<b>FORM user_command USING r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.</b>

CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'VBELN'.
READ TABLE itab INTO wa INDEX rs_selfield-tabindex.
SET PARAMETER ID 'AUN' FIELD wa-vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
IF <b>rs_selfield-fieldname = 'VBELN'.</b>
READ TABLE itab INTO wa INDEX rs_selfield-tabindex.
SET PARAMETER ID 'VF' FIELD wa-vbeln.
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM.

Make sure that u r passing the correct field name specify the field name that u have defined in ur final internal table if u have used vbeln_1 then pass the same.

Otherwise the wrong values will get passed.

Hope this solves ur problem.

Reward points and close thread.

Message was edited by: Judith Jessie Selvi

Read only

0 Likes
2,543

Hi Selvi..

I have done

i_callback_user_command = 'USER_COMMAND'

raju

Read only

0 Likes
2,543

Then u just take care of

rs_selfield-fieldname = 'VBELN' as both the fieldnames are equal to vbeln u might have declred any one of them with a different fieldname in ur internal table right?

Then u can pass that fieldnam here in CAPS.

Rest of the things are fine.

U can reward points and close the thread if ur problem got solved.

Read only

Former Member
0 Likes
2,544

Hi,

Second one should be :

IF rs_selfield-fieldname = 'VBEL1'.
READ TABLE itab INTO wa INDEX rs_selfield-tabindex.
SET PARAMETER ID 'VF' FIELD wa-vbel1.
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
ENDIF.

regards,

Erwan.

Read only

0 Likes
2,543

hi Ravi and Erwan

i have tried...

but not..

raju

Read only

0 Likes
2,543

I've this, and it works fine :

*----------------------------------------------*
*       FORM                                   *
*----------------------------------------------*
FORM user_command USING ucomm LIKE sy-ucomm
                     selfield TYPE slis_selfield.

  READ TABLE itab INDEX selfield-tabindex.
  IF selfield-sel_tab_field EQ 'ITAB-VBELN'.
    SET PARAMETER ID 'AUF' FIELD itab-vbeln.
    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
  ENDIF.
 ...
ENDFORM.                    "user_command

Regards,

Erwan.

Message was edited by: Erwan LE BRUN

Message was edited by: Erwan LE BRUN

Read only

0 Likes
2,543

Hi Raju,

By ITAB-VBELN what I meant was the name of the internal table you are using to display the data.

Anyways, Did you try putting a break point at that location and check the rsselfield value .

ravi

Read only

0 Likes
2,543

Hi Raju,

The parameter Id are different for different document types.here is the list of parameter IDs for Sales Order Number VBELN

The following parameters are available for the individual document types:

AFN - Inquiry number

AGN - Quotation number

AUN - Order number

LPN - Scheduling agreement number

KTN - Contract number

AMN - Assortment number

Try using any of them instead of AUN, if the problem is still there.

Thanks,

Ravi

Read only

0 Likes
2,543

Hi ravi ,,

I am sorry to disturb you all....

it is still unsolved///..

this is my complete code ....

go trough this...

*&----


*

*& Report ZKUNDEN_ANALYSIS *

*& *

*&----


*

*& *

*& *

*&----


*

REPORT ZKUNDEN_ANALYSIS .

type-pools slis.

tables: sscrfields.

data: fieldcat type slis_t_fieldcat_alv .

data: sort type slis_t_sortinfo_alv.

data : begin of wa occurs 0,


kunnr type knc1-kunnr,
gjahr type knc1-gjahr,
erdat type knc1-erdat,
um01s type knc1-um01s,
um01h type knc1-um01h,
um01u type knc1-um01u,
um02s type knc1-um02s,
um02h type knc1-um02h,
um02u type knc1-um02u,
um03s type knc1-um03s,
um03h type knc1-um03h,
um03u type knc1-um03u,
um04s type knc1-um04s,
um04h type knc1-um04h,
um04u type knc1-um04u,
um05s type knc1-um05s,
um05h type knc1-um05h,
um05u type knc1-um05u,
um06s type knc1-um06s,
um06h type knc1-um06h,
um06u type knc1-um06u,
um07s type knc1-um07s,
um07h type knc1-um07h,
um07u type knc1-um07u,
um08s type knc1-um08s,
um08h type knc1-um08h,
um08u type knc1-um08u,
um09s type knc1-um09s,
um09h type knc1-um09h,
um09u type knc1-um09u,
um10s type knc1-um10s,
um10h type knc1-um10h,
um10u type knc1-um10u,
um11s type knc1-um11s,
um11h type knc1-um11h,
um11u type knc1-um11u,
um12s type knc1-um12s,
um12h type knc1-um12h,
um12u type knc1-um12u,
um13s type knc1-um13s,
um13h type knc1-um13h,
um13u type knc1-um13u,
um14s type knc1-um14s,
um14h type knc1-um14h,
um14u type knc1-um14u,
um15s type knc1-um15s,
um15h type knc1-um15h,
um15u type knc1-um15u,
um16s type knc1-um16s,
um16h type knc1-um16h,
um16u type knc1-um16u,

umsav type knc1-umsav,



name1 type kna1-name1,
ktokd type kna1-ktokd,
werks TYPE KNA1-werks,
lgort type kna1-lgort,
uwaer type kna1-uwaer,
ernam type kna1-ernam,
umsat type kna1-umsat,
lzone type kna1-lzone,
SPERZ type kna1-SPERZ,
kokrs type kna1-kokrs,
kostl type kna1-kostl,
name2 type kna1-name2,
adrnr type kna1-adrnr,
kunn2 type kna1-kunnr,

vkorg type knvv-vkorg,
waers type knvv-waers,
vtweg type knvv-vtweg,
spart type knvv-spart,

matnr type mara-matnr,
matkl type mara-matkl,

vbeln type vbap-vbeln,

audat type vbap-audat,
netpr type vbap-netpr,
netwr type vbap-netwr,
arktx type vbap-arktx,
vrkme type vbap-vrkme,
waerk type vbap-waerk,
meins type vbap-meins,
aufnr type vbap-aufnr,

vtwe1 type vbak-vtweg,
vkor1 type vbak-vkorg,
kunn1 type vbak-kunnr,
auart type vbak-auart,


BATOT LIKE KNC1-UM07U,
DETOT LIKE KNC1-UM07S,
CETOT LIKE KNC1-UM07H,

lbkum type mbew-lbkum,


vbel1 type vbrp-vbeln,

posnr type vbrp-posnr,
fkimg type vbrp-fkimg,
vrkm1 type vbrp-vrkme,
ntgew type vbrp-ntgew,
vgbel type vbrp-vgbel,
aubel type vbrp-aubel,
matn2 type vbrp-matnr,
arkt2 type vbrp-arktx,
matk2 type vbrp-matkl,
werk2 type vbrp-werks,
lgor2 type vbrp-lgort,
auda2 type vbrp-audat,
erda2 type vbrp-erdat,
netw2 type vbrp-netwr,

fkart type vbrk-fkart,
fktyp type vbrk-fktyp,
belnr type vbrk-belnr,
gjah2 type vbrk-gjahr,
kunrg type vbrk-kunrg,
kunag type vbrk-kunag,
mwsbk type vbrk-mwsbk.


data :end of wa.

data : itab like table of wa WITH HEADER LINE.


data: cursorfield(50) type c.


data: BATOT like knc1-umsav,
DETOT LIKE KNC1-UMSAV,
CETOT LIKE KNC1-UMSAV.


data: gd_tab_group type slis_t_sp_group_alv with header line,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.


SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-012.

SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-001.

parameters: C2 as checkbox USER-COMMAND CHECK default 'c2'.

SELECTION-SCREEN BEGIN OF BLOCK A3 WITH FRAME TITLE TEXT-002.

SELECT-OPTIONS : s_matnr for wa-matnr,
s_kunn1 for wa-kunnr,

s_vbeln for wa-vbeln,

s_audat for wa-audat,
s_aufnr for wa-aufnr.

SELECTION-SCREEN END OF BLOCK A3.

SELECTION-SCREEN BEGIN OF BLOCK A4 WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS : s_auart for wa-auart,
s_vtwe1 for wa-vtweg,
s_meins for wa-meins,
s_vkor1 for wa-vkorg.

PARAMETER: gd_ucomm like sy-ucomm default 'BUT1' no-display.

SELECTION-SCREEN END OF BLOCK A4.

SELECTION-SCREEN END OF BLOCK A.

SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-004.

parameters: C1 as checkbox USER-COMMAND CHECK .

SELECTION-SCREEN BEGIN OF BLOCK A2 WITH FRAME TITLE TEXT-005.

SELECT-OPTIONS : s_kunnr for wa-kunnr,
s_vtweg for wa-vtweg,
s_spart for wa-spart,
s_erdat for wa-erdat,
s_vkorg for wa-vkorg,
s_gjahr for wa-gjahr.

SELECTION-SCREEN END OF BLOCK A2.

SELECTION-SCREEN END OF BLOCK A1.

SELECTION-SCREEN BEGIN OF BLOCK A7 WITH FRAME TITLE TEXT-007.

parameters: C3 as checkbox USER-COMMAND CHECK.

SELECTION-SCREEN BEGIN OF BLOCK A8 WITH FRAME TITLE TEXT-008.

SELECT-OPTIONS :

s_vbel1 for wa-vbel1,

s_kunrg for wa-kunrg,

s_erda2 for wa-erdat,

s_matn2 for wa-matnr,

s_aubel for wa-aubel.

  • s_belnr for wa-belnr.

SELECTION-SCREEN END OF BLOCK A8.

SELECTION-SCREEN BEGIN OF BLOCK A9 WITH FRAME TITLE TEXT-009.

SELECT-OPTIONS :

  • s_kunag for wa-kunag,

  • s_gjah2 for wa-gjahr,

s_posnr for wa-posnr,

s_fkart for wa-fkart,

s_fktyp for wa-fktyp.

SELECTION-SCREEN END OF BLOCK A9.

SELECTION-SCREEN END OF BLOCK A7.

SELECTION-SCREEN END OF BLOCK B.

Start-of-selection.

perform build_events.

perform build_print_params.

if not C2 is initial.

select mara~matnr

vbapvbeln</b> vbakkunnr

vbak~vkorg

vbap~audat

vbak~vtweg

vbak~auart

vbap~arktx

vbap~vrkme

vbap~waerk

vbap~netpr

vbap~netwr

MBEW~LBKUM

vbap~meins

vbap~aufnr

  • vbap~matnr

into corresponding fields of TABLE ITAB FROM vbap

inner join mara

on vbapmatnr = maramatnr

inner join vbak

on vbapvbeln = vbakvbeln

inner join mbew

on vbapmatnr = mbewmatnr

WHERE MARA~MATNR IN S_MATNR

and vbapvbeln in s_vbeln</b> and vbakkunnr in s_kunn1

and vbak~auart in s_auart

and vbap~audat in s_audat

and vbak~vtweg in s_vtwe1

and vbap~meins in s_meins

and vbap~aufnr in s_aufnr

and vbak~vkorg in s_vkor1.

elseif not C1 is initial.

select knc1~kunnr

knc1~bukrs

knc1~gjahr

knc1~erdat

knc1~usnam

knc1~um01s

knc1~um01h

knc1~um01u

knc1~um02s

knc1~um02h

knc1~um02u

knc1~um03s

knc1~um03h

knc1~um03u

knc1~um04s

knc1~um04h

knc1~um04u

knc1~um05s

knc1~um05h

knc1~um05u

knc1~um06s

knc1~um06h

knc1~um06u

knc1~um07s

knc1~um07h

knc1~um07u

knc1~um08s

knc1~um08h

knc1~um08u

knc1~um09s

knc1~um09h

knc1~um09u

knc1~um10s

knc1~um10h

knc1~um10u

knc1~um11s

knc1~um11h

knc1~um11u

knc1~um12s

knc1~um12h

knc1~um12u

knc1~um13s

knc1~um13h

knc1~um13u

knc1~um14s

knc1~um14h

knc1~um14u

knc1~um15s

knc1~um15h

knc1~um15u

knc1~um16s

knc1~um16h

knc1~um16u

kna1~name1

kna1~ktokd

kna1~werks

kna1~uwaer

kna1~ernam

kna1~umsat

kna1~lzone

kna1~SPERZ

kna1~lgort

kna1~kokrs

kna1~kostl

kna1~name2

kna1~adrnr

KNVV~VKORG

knvv~waers

knvv~vtweg

knvv~spart

into corresponding fields of table itab from knc1

inner join kna1

on knc1kunnr = kna1kunnr

inner join knvv

on KNC1kunnr = knvvkunnr

where knc1~kunnr in s_kunnr

and knc1~erdat in s_erdat

and knvv~vkorg in s_vkorg

and knc1~gjahr in s_gjahr

and knvv~vtweg in s_vtweg

and knvv~spart in s_spart.

LOOP AT ITAB.

ITAB-DETOT = ITAB-UM01S + ITAB-UM02S + ITAB-UM03S + ITAB-UM04S +

ITAB-UM05S + ITAB-UM06S + ITAB-UM07S + ITAB-UM08S + ITAB-UM09S +

ITAB-UM10S + ITAB-UM11S + ITAB-UM12S + ITAB-UM13S + ITAB-UM14S +

ITAB-UM15S + ITAB-UM16S .

ITAB-CETOT = ITAB-UM01H + ITAB-UM02H + ITAB-UM03H + ITAB-UM04H +

ITAB-UM05S + ITAB-UM06H + ITAB-UM07H + ITAB-UM08H + ITAB-UM09H +

ITAB-UM10S + ITAB-UM11H + ITAB-UM12H + ITAB-UM13H + ITAB-UM14H +

ITAB-UM15S + ITAB-UM16H .

ITAB-BATOT = ITAB-UM01U + ITAB-UM02U + ITAB-UM03U + ITAB-UM04U +

ITAB-UM05U + ITAB-UM06U + ITAB-UM07U + ITAB-UM08U + ITAB-UM09U +

ITAB-UM10U + ITAB-UM11U + ITAB-UM12U + ITAB-UM13U + ITAB-UM14U +

ITAB-UM15U + ITAB-UM16U .

MODIFY ITAB.

ENDLOOP.

elseif not C3 is initial.

select

vbrp~vbeln

vbrp~posnr

vbrp~fkimg

vbrp~vrkme

vbrp~ntgew

vbrp~vgbel

vbrp~aubel

vbrp~matnr

vbrp~arktx

vbrp~matkl

vbrp~werks

vbrp~lgort

vbrp~audat

vbrp~erdat

vbrp~netwr

vbrk~fkart

vbrk~fktyp

vbrk~belnr

vbrk~gjahr

vbrk~kunrg

vbrk~kunag

vbrk~mwsbk

into corresponding fields of TABLE ITAB FROM vbrp

inner join VBRK

on vbrpvbeln = vbrkvbeln

WHERE vbrpvbeln in s_vbel1</b> and vbrperdat in s_erda2

and vbrp~matnr in s_matn2

and vbrp~posnr in s_posnr

and vbrp~aubel in s_aubel

  • and vbrk~belnr in s_belnr

  • and vbrk~kunag in s_kunag

  • and vbrk~gjahr in s_gjah2

and vbrk~fkart in s_fkart

and vbrk~fktyp in s_fktyp

and vbrk~kunrg in s_kunrg.

endif.

perform write_report.

form write_report.

if not C2 is initial.

perform build_field_catalog.

elseif not C1 is initial.

perform build_field_catalog1.

elseif not C3 is initial.

perform build_field_catalog2.

endif.

*&----


*

*& Form BUILD_LAYOUT

*&----


*

  • Build layout for ALV grid report

*----


*

*form build_layout.

gd_layout-no_input = 'X'.

gd_layout-colwidth_optimize = 'X'.

gd_layout-totals_text = 'Totals'(201).

gd_layout-totals_only = 'X'.

  • gd_layout-f2code = 'DISP'. "Sets fcode for when double

  • "click(press f2)

gd_layout-info_fieldname = 'LINE_COLOR'.

gd_layout-info_fieldname = 'WS_COLOR'.

gd_layout-zebra = 'X'.

gd_layout-group_change_edit = 'X'.

gd_layout-header_text = 'HELLO'.

*endform. " BUILD_LAYOUT

*&----


*

*& Form DISPLAY_ALV_REPORT

*&----


*

  • Display report using ALV grid

*----


*

*form display_alv_report.

gd_repid = sy-repid.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

i_callback_user_command = 'USER_COMMAND'

  • i_grid_title = outtext

is_layout = gd_layout

it_fieldcat = fieldcat

it_sort = sort

  • it_special_groups = gd_tabgroup

it_events = gt_events

is_print = gd_prntparams

i_save = 'X'

  • is_variant = z_template

tables

t_outtab = itab

exceptions

program_error = 1

others = 2.

  • CALL FUNCTION REUSE_ALV_COMMENTARY_WRITE

  • EXPORTING

  • I_LOGO = 'W3MI'.

*

  • if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • endif.

endform. " DISPLAY_ALV_REPORT

************************************************************************

*BUILD_FIELD_CATALOG

************************************************************************

form build_field_catalog.

data: fc_tmp type slis_t_fieldcat_alv with header line.

clear: fieldcat.

refresh: fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Materialnummer'.

fc_tmp-fieldname = 'MATNR'.

fc_tmp-tabname = 'wa'.

fc_tmp-key = 'X'.

fc_tmp-outputlen = '15'.

fc_tmp-col_pos = 1.

  • fc_tmp-do_sum = 'X'.

  • fc_tmp-emphasize = 'C500'.

fc_tmp-hotspot = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Kunde'.

fc_tmp-fieldname = 'KUNNR'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 3.

fc_tmp-emphasize = 'C501'.

fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Verkaufsbeleg '.

fc_tmp-fieldname = 'VBELN'.

fc_tmp-key = 'X'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 2.

  • fc_tmp-edit = 'C100'.

  • fc_tmp-emphasize = 'C500'.

fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.</b> append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Verk-orgn'.

fc_tmp-fieldname = 'VKORG'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 4.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Vertriebsweg'.

fc_tmp-fieldname = 'VTWEG'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 5.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'AuftragsNr'.

fc_tmp-fieldname = 'AUFNR'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 6.

fc_tmp-emphasize = 'C601'.

fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Verkaufsbelegart'.

fc_tmp-fieldname = 'AUART'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 7.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Nettopries'.

fc_tmp-fieldname = 'NETPR'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 8.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Nettowert'.

fc_tmp-fieldname = 'NETWR'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 9.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'SD-BelegposDatum'.

fc_tmp-fieldname = 'AUDAT'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 10.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Bezeichnung'.

fc_tmp-fieldname = 'ARKTX'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '18'.

fc_tmp-col_pos = 11.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Mengeneinheit '.

fc_tmp-fieldname = 'VRKME'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 12.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Währung'.

fc_tmp-fieldname = 'WAERK'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 13.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Tot valuated stk'.

fc_tmp-fieldname = 'LBKUM'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '10'.

fc_tmp-col_pos = 14.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

endform.

************************************************************************

*

*BUILD_FIELD_CATALOG

************************************************************************

form build_field_catalog1.

data: fc_tmp type slis_t_fieldcat_alv with header line.

clear: fieldcat.

refresh: fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Kunde'.

fc_tmp-fieldname = 'KUNNR'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '11'.

fc_tmp-key = 'X'.

fc_tmp-col_pos = 1.

  • fc_tmp-emphasize = 'C500'.

fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Kundename'.

fc_tmp-fieldname = 'NAME1'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-key = 'X'.

fc_tmp-outputlen = '20'.

fc_tmp-col_pos = 2.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'jahr'.

fc_tmp-fieldname = 'GJAHR'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '4'.

fc_tmp-col_pos = 3.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Datum,Satz'.

fc_tmp-fieldname = 'ERDAT'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 4.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Kon-grup'.

fc_tmp-fieldname = 'KTOKD'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '4'.

fc_tmp-col_pos = 5.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Währung'.

fc_tmp-fieldname = 'WAERS'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '4'.

fc_tmp-col_pos = 6.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 01********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'V-org'.

fc_tmp-fieldname = 'VKORG'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '5'.

fc_tmp-col_pos = 7.

fc_tmp-no_zero = 'X'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Name'.

fc_tmp-fieldname = 'ERNAM'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 8.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Jahr-Verk'.

fc_tmp-fieldname = 'UMSAT'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '7'.

  • fc_tmp-emphasize = 'C500'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 9.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Tra-zone'.

fc_tmp-fieldname = 'LZONE'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-outputlen = '5'.

fc_tmp-col_pos = 10.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Zahlsperre'.

fc_tmp-fieldname = 'SPERZ'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 11.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

*

  • clear: fc_tmp.

  • fc_tmp-reptext_ddic = 'Werk'.

  • fc_tmp-fieldname = 'WERKS'.

  • fc_tmp-tabname = 'wa'.

  • fc_tmp-no_zero = 'X'.

    • fc_tmp-emphasize = 'C500'.

    • fc_tmp-hotspot = 'X'.

  • fc_tmp-outputlen = '4'.

  • fc_tmp-col_pos = 10.

  • fc_tmp-do_sum = 'X'.

*

  • append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Kumulierter Haben'.

fc_tmp-fieldname = 'DETOT'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-outputlen = '4'.

fc_tmp-col_pos = 12.

fc_tmp-no_zero = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Kumulierter Soll'.

fc_tmp-fieldname = 'CETOT'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-outputlen = '4'.

fc_tmp-col_pos = 13.

fc_tmp-no_zero = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Differenz Umsatz'.

fc_tmp-fieldname = 'BATOT'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-outputlen = '4'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 14.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 1'.

fc_tmp-fieldname = 'UM01S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 15.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 1'.

fc_tmp-fieldname = 'UM01H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 16.

fc_tmp-emphasize = 'C300'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-hotspot = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 1'.

fc_tmp-fieldname = 'UM01U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 17.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 02********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 2'.

fc_tmp-fieldname = 'UM02S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 18.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 2'.

fc_tmp-fieldname = 'UM02H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 19.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 2'.

fc_tmp-fieldname = 'UM02U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 20.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 03********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 3'.

fc_tmp-fieldname = 'UM03S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 21.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 3'.

fc_tmp-fieldname = 'UM03H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 22.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 3'.

fc_tmp-fieldname = 'UM03U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 23.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 04********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 4'.

fc_tmp-fieldname = 'UM04S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 24.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 4'.

fc_tmp-fieldname = 'UM04H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 25.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 4'.

fc_tmp-fieldname = 'UM04U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 26.

  • fc_tmp-hotspot = 'X'.

fc_tmp-no_zero = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 05********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 5'.

fc_tmp-fieldname = 'UM05S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 27.

fc_tmp-emphasize = 'C700'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 5'.

fc_tmp-fieldname = 'UM05H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 28.

fc_tmp-no_zero = 'X'.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 5'.

fc_tmp-fieldname = 'UM05U'.

fc_tmp-tabname = 'wa'.

fc_tmp-no_zero = 'X'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 29.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 06********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 6'.

fc_tmp-fieldname = 'UM06S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 31.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 6'.

fc_tmp-fieldname = 'UM06H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 31.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 6'.

fc_tmp-fieldname = 'UM06U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 32.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 07********

clear: fc_tmp.

fc_tmp-no_zero = 'X'.

fc_tmp-reptext_ddic = 'H-Period 7'.

fc_tmp-fieldname = 'UM07S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 33.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 7'.

fc_tmp-fieldname = 'UM07H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 34.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 7'.

fc_tmp-fieldname = 'UM07U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 35.

  • fc_tmp-hotspot = 'X'.

fc_tmp-no_zero = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 08********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 8'.

fc_tmp-fieldname = 'UM08S'.

fc_tmp-tabname = 'wa'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 36.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 8'.

fc_tmp-fieldname = 'UM08H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 37.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 8'.

fc_tmp-fieldname = 'UM08U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 38.

fc_tmp-no_zero = 'X'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 09********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 9'.

fc_tmp-fieldname = 'UM09S'.

fc_tmp-tabname = 'wa'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 39.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 9'.

fc_tmp-fieldname = 'UM09H'.

fc_tmp-tabname = 'wa'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 40.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 9'.

fc_tmp-fieldname = 'UM09U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 41.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 10********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 10'.

fc_tmp-fieldname = 'UM10S'.

fc_tmp-tabname = 'wa'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 42.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 10'.

fc_tmp-fieldname = 'UM10H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 43.

fc_tmp-no_zero = 'X'.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 10'.

fc_tmp-fieldname = 'UM10U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 44.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 11********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 11'.

fc_tmp-fieldname = 'UM11S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 45.

fc_tmp-emphasize = 'C700'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 11'.

fc_tmp-fieldname = 'UM11H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 46.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 11'.

fc_tmp-fieldname = 'UM11U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 47.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

fc_tmp-no_zero = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the period 12********

clear: fc_tmp.

fc_tmp-no_zero = 'X'.

fc_tmp-reptext_ddic = 'S-Period 12'.

fc_tmp-fieldname = 'UM12S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 48.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 12'.

fc_tmp-no_zero = 'X'.

fc_tmp-fieldname = 'UM12H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 49.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 12'.

fc_tmp-fieldname = 'UM12U'.

fc_tmp-tabname = 'wa'.

fc_tmp-no_zero = 'X'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 50.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the special period 13********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 13'.

fc_tmp-fieldname = 'UM13S'.

fc_tmp-no_zero = 'X'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 51.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 13'.

fc_tmp-fieldname = 'UM13H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 52.

fc_tmp-emphasize = 'C300'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'U-Period 13'.

fc_tmp-fieldname = 'UM13U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 53.

  • fc_tmp-hotspot = 'X'.

fc_tmp-no_zero = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the special period 14********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 14'.

fc_tmp-fieldname = 'UM14S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 54.

fc_tmp-no_zero = 'X'.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 14'.

fc_tmp-fieldname = 'UM14H'.

fc_tmp-no_zero = 'X'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 55.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 14'.

fc_tmp-fieldname = 'UM14U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

fc_tmp-no_zero = 'X'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 56.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the special period 15********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 15'.

fc_tmp-fieldname = 'UM15S'.

fc_tmp-no_zero = 'X'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 57.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 15'.

fc_tmp-fieldname = 'UM15H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 58.

fc_tmp-no_zero = 'X'.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 15'.

fc_tmp-fieldname = 'UM15U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 59.

fc_tmp-no_zero = 'X'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

                    • amount field catalog for the special period 16********

clear: fc_tmp.

fc_tmp-reptext_ddic = 'S-Period 16'.

fc_tmp-fieldname = 'UM16S'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 60.

fc_tmp-emphasize = 'C700'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'H-Period 16'.

fc_tmp-fieldname = 'UM16H'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 61.

fc_tmp-emphasize = 'C300'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'D-Period 16'.

fc_tmp-fieldname = 'UM16U'.

fc_tmp-tabname = 'wa'.

fc_tmp-emphasize = 'C500'.

  • fc_tmp-outputlen = '8'.

fc_tmp-no_zero = 'X'.

fc_tmp-col_pos = 62.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

endform.

************************************************************************

*BUILD_FIELD_CATALOG

************************************************************************

form build_field_catalog2.

data: fc_tmp type slis_t_fieldcat_alv with header line.

clear: fieldcat.

refresh: fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Faktura'.

fc_tmp-fieldname = 'VBELN'.

fc_tmp-tabname = 'wa'.

fc_tmp-key = 'X'.

fc_tmp-outputlen = '15'.

fc_tmp-col_pos = 1.

  • fc_tmp-do_sum = 'X'.

  • fc_tmp-emphasize = 'C500'.

fc_tmp-hotspot = 'X'.

append fc_tmp to fieldcat.</b>

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Regulierer'.

fc_tmp-fieldname = 'KUNRG'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 2.

fc_tmp-emphasize = 'C501'.

fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Faktura Datum '.

fc_tmp-fieldname = 'ERDAT'.

  • fc_tmp-key = 'X'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 3.

  • fc_tmp-edit = 'C100'.

  • fc_tmp-emphasize = 'C500'.

fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Fakturaart'.

fc_tmp-fieldname = 'FKART'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '8'.

fc_tmp-col_pos = 4.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Fak-typ'.

fc_tmp-fieldname = 'FKTYP'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 5.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Fak-position'.

fc_tmp-fieldname = 'POSNR'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 6.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'fak-Menge'.

fc_tmp-fieldname = 'FKIMG'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 7.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Nettowert'.

fc_tmp-fieldname = 'NETWR'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 8.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Ver-menge'.

fc_tmp-fieldname = 'VRKME'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 9.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Nettogewicht'.

fc_tmp-fieldname = 'NTGEW'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '18'.

fc_tmp-col_pos = 10.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Vorlagebeleges'.

fc_tmp-fieldname = 'VGBEL'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 11.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Verkaufsbeleg'.

fc_tmp-fieldname = 'AUBEL'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 12.

  • fc_tmp-emphasize = 'C301'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Materialnummer'.

fc_tmp-fieldname = 'MATNR'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

fc_tmp-emphasize = 'C601'.

fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 13.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Kundenauftragsposition'.

fc_tmp-fieldname = 'ARKTX'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 14.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Warengruppe'.

fc_tmp-fieldname = 'MATKL'.

fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '8'.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-col_pos = 15.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Werk'.

fc_tmp-fieldname = 'WERKS'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '18'.

fc_tmp-col_pos = 16.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Lagerort'.

fc_tmp-fieldname = 'LGORT'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 17.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Belegdatum '.

fc_tmp-fieldname = 'AUDAT'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 18.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

  • fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

*

*clear: fc_tmp.

  • fc_tmp-reptext_ddic = 'Buchhaltungsbeleges'.

  • fc_tmp-fieldname = 'BELNR'.

  • fc_tmp-tabname = 'wa'.

    • fc_tmp-outputlen = '8'.

    • fc_tmp-emphasize = 'C500'.

    • fc_tmp-hotspot = 'X'.

  • fc_tmp-col_pos = 19.

    • fc_tmp-do_sum = 'X'.

*

  • append fc_tmp to fieldcat.

*

*clear: fc_tmp.

  • fc_tmp-reptext_ddic = 'Jahr'.

  • fc_tmp-fieldname = 'GJAHR'.

  • fc_tmp-tabname = 'wa'.

  • fc_tmp-outputlen = '18'.

  • fc_tmp-col_pos = 20.

    • fc_tmp-emphasize = 'C500'.

    • fc_tmp-hotspot = 'X'.

    • fc_tmp-do_sum = 'X'.

*

  • append fc_tmp to fieldcat.

clear: fc_tmp.

fc_tmp-reptext_ddic = 'Steuerbetrag '.

fc_tmp-fieldname = 'MWSBK'.

fc_tmp-tabname = 'wa'.

fc_tmp-outputlen = '6'.

fc_tmp-col_pos = 19.

  • fc_tmp-emphasize = 'C500'.

  • fc_tmp-hotspot = 'X'.

fc_tmp-do_sum = 'X'.

append fc_tmp to fieldcat.

endform.

*----


*

  • FORM USER_COMMAND *

*----


*

  • --> R_UCOMM *

  • --> RS_SELFIELD *

*----


*

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

  • Check function code

CASE r_ucomm.

WHEN '&IC1'.

  • Check field clicked on within ALVgrid report

IF rs_selfield-fieldname = 'VBELN'.

    • Read data table, using index of row user clicked on

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

    • with key VBELN = rs_selfield-value

    • Set parameter ID for transaction screen field

SET PARAMETER ID 'AUN' FIELD wa-vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

*

ENDIF.

*

IF rs_selfield-fieldname = 'VBELN'.

  • Read data table, using index of row user clicked on

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'VF' FIELD wa-vbel1.

CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.

ENDIF.</b>

IF rs_selfield-fieldname = 'MATNR'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'MAT' FIELD wa-matnr.

CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.

ENDIF.

IF rs_selfield-fieldname = 'AUFNR'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'ANR' FIELD wa-AUFNR.

CALL TRANSACTION 'KOB1' AND SKIP FIRST SCREEN.

ENDIF.

*

IF rs_selfield-fieldname = 'KUNNR'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'KUN' FIELD wa-KUNNR.

CALL TRANSACTION 'VD03' AND SKIP FIRST SCREEN.

ENDIF.

IF rs_selfield-fieldname = 'KUNRG'.

READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'KUN' FIELD wa-KUNRG.

CALL TRANSACTION 'VD03' AND SKIP FIRST SCREEN.

ENDIF.

*

  • IF rs_selfield-fieldname = 'VBELN'.

  • READ TABLE itab INTO wa INDEX rs_selfield-tabindex.

    • Set parameter ID for transaction screen field

  • SET PARAMETER ID 'VF' FIELD wa-VBELN.

  • CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.

  • ENDIF.

*

ENDCASE.

ENDFORM.

**----


*

    • Form TOP-OF-PAGE *

**----


*

    • ALV Report Header *

**----


*

*

form top-of-page.

*ALV Header declarations

data: t_header type slis_t_listheader,

wa_header type slis_listheader,

t_line like wa_header-info,

ld_lines type i,

ld_linesc(10) type c.

  • Title WA

wa_header-typ = 'H'.

wa_header-info = 'KUNDENANALYSE'.

append wa_header to t_header.

clear wa_header.

  • Date

wa_header-typ = 'S'.

wa_header-key = 'Date: '.

concatenate sy-datum+6(2) '.'

sy-datum+4(2) '.'

sy-datum(4) into wa_header-info. "todays date

append wa_header to t_header.

clear: wa_header.

  • Total No. of Records Selected

describe table itab lines ld_lines.

ld_linesc = ld_lines.

concatenate 'Total No. of Records Selected: ' ld_linesc

into t_line separated by space.

wa_header-typ = 'A'.

wa_header-info = t_line.

append wa_header to t_header.

clear: wa_header , t_line.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = t_header

i_logo = 'ENJOYSAP_LOGO'.

endform.

*&----


*

*& Form BUILD_EVENTS

*&----


*

  • Build events table

*----


*

form build_events.

data: ls_event type slis_alv_event.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 1

importing

et_events = gt_events[].

read table gt_events with key name = slis_ev_end_of_page

into ls_event.

if sy-subrc = 0.

move 'END_OF_PAGE' to ls_event-form.

append ls_event to gt_events.

endif.

read table gt_events with key name = slis_ev_end_of_list

into ls_event.

if sy-subrc = 0.

move 'END_OF_LIST' to ls_event-form.

append ls_event to gt_events.

endif.

endform. " BUILD_EVENTS

*&----


*

*& Form BUILD_PRINT_PARAMS

*&----


*

  • Setup print parameters

*----


*

form build_print_params.

gd_prntparams-reserve_lines = '9'. "Lines reserved for footer

gd_prntparams-no_coverpage = 'X'.

endform. " BUILD_PRINT_PARAMS

*&----


*

*& Form END_OF_PAGE

*&----


*

form END_OF_PAGE.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

write: sy-uline(50).

skip.

write:/40 'Page:', sy-pagno .

endform.

*&----


*

*& Form END_OF_LIST

*&----


*

form END_OF_LIST.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

skip.

write:/40 'Page:', sy-pagno .

endform.

at selection-screen.

get cursor field cursorfield .

if cursorfield = 'C2' .

C1 = space.

C3 = space.

elseif cursorfield = 'C1'.

c2 = space.

C3 = space.

elseif cursorfield = 'C3'.

c2 = space.

c1 = space.

endif.

raju...

Message was edited by: mpr raju

Read only

0 Likes
2,543

Do as below

In the fieldcatalog the second bold filedname vbeln

clear: fc_tmp.
fc_tmp-reptext_ddic = 'Faktura'.
<b>fc_tmp-fieldname = 'VBEL1'</b>.
fc_tmp-tabname = 'wa'.
fc_tmp-key = 'X'.
fc_tmp-outputlen = '15'.
fc_tmp-col_pos = 1.
* fc_tmp-do_sum = 'X'.
* fc_tmp-emphasize = 'C500'.
fc_tmp-hotspot = 'X'.

append fc_tmp to fieldcat.

FORM user_command USING r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.
 
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'VBELN'.
READ TABLE itab INTO wa INDEX rs_selfield-tabindex.
SET PARAMETER ID 'AUN' FIELD wa-vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
IF rs_selfield-fieldname = <b>'VBEL1'</b>.
READ TABLE itab INTO wa INDEX rs_selfield-tabindex.
SET PARAMETER ID 'VF' FIELD <b>wa-vbel1.</b>
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM.

Make these changes i have mentioned in bold.

It will work fine.

Read only

0 Likes
2,543

Why do you use the "case/endcase".

Take a look at this example :


*---------------------------------------------*
* FORM user_command                           *
*---------------------------------------------*
FORM user_command USING ucomm LIKE sy-ucomm
                     selfield TYPE slis_selfield.

  READ TABLE t_finale INDEX selfield-tabindex.
  IF selfield-sel_tab_field EQ 'T_FINALE-MATNR'.
    SET PARAMETER ID 'MAT' FIELD t_finale-matnr.
    SET PARAMETER ID 'WRK' FIELD p_werks.
    CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN.
  ENDIF.
  IF selfield-sel_tab_field EQ 'T_FINALE-ARBPL'.
    SET PARAMETER ID 'AGR' FIELD t_finale-arbpl.
    SET PARAMETER ID 'WRK' FIELD p_werks.
    CALL TRANSACTION 'CR03'.
  ENDIF.

ENDFORM.                    "user_command

Hope it helps.

Erwan.

Read only

0 Likes
2,543

Hi,

Here is the sample code.

Step 1:Add the user-command in events.

DATA: i_events TYPE slis_t_event.

FORM f4000_events_init CHANGING i_events TYPE slis_t_event.

DATA: line_event TYPE slis_alv_event.

CLEAR line_event.

line_event-name = 'USER_COMMAND'.

line_event-form = 'F4300_USER_COMMAND'.

APPEND line_event TO i_events.

ENDFORM. " f3000_events_init

Step 2;Define the user command

FORM f4300_user_command USING ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

CASE ucomm.

WHEN '&IC1'.

IF selfield-fieldname = 'VBELN'.

READ TABLE itab INTO wa INDEX selfield-tabindex.

SET PARAMETER ID 'AUN' FIELD wa-vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

ENDIF.

....

endcase.

Step 3:pass the event parameter in FM

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

....

it_events = i_events

...

EXCEPTIONS

program_error = 1

OTHERS = 2.

Kindly reward points if it helps.

Read only

0 Likes
2,543

Dear Selvi,..

i have done like this ....but in the place on billing document there is no documents......field output in all the rows are balnk..

raju..

Read only

0 Likes
2,543

Then that <b>is not the coding problem</b> get some test data and test with billing documents,

IF rs_selfield-fieldname = 'VBEL1'.
READ TABLE itab INTO wa INDEX rs_selfield-tabindex.
<b>IF NOT wa-vbel1 IS INITIAL.</b>
SET PARAMETER ID 'VF' FIELD wa-vbel1.
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
<b>ENDIF.</b>
ENDIF.

U can do a check before calling transaction too.

If needed display a mess saying no docu found when u click vbel1.

Hope this helps.

Read only

Former Member
0 Likes
2,543

HI Raju,

I think the statement

IF rs_selfield-fieldname = 'VBELN'.

should be

IF rs_selfield-fieldname = 'ITAB-VBELN'.

Regards,

Ravi

Read only

Former Member
0 Likes
2,543

Try something like this:

Data : mycatch(20). " to hold field data.

At line-selection.

Get cursor field mycatch value : field1 , field2.

Case mycatch.

When 'FIELD1'.

" do something...

When 'FIELD2'.

" do something else...

Endcase.