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

ALV

Former Member
0 Likes
1,563

HI,

REPORT Z50874_REUSE_ALV_FIELDMERGE.

TYPES : BEGIN OF st_ekko,

ebeln TYPE ekko-ebeln, "Purchasing Document Number

bstyp TYPE ekko-bstyp, "Purchasing Document Category

bsart TYPE ekko-bsart, "Purchasing Document Type

aedat TYPE ekko-aedat, "record created on

ernam TYPE ekko-ernam, "Person who Created the Object

END OF st_ekko.

TYPE-POOLS:SLIS.

DATA : it_ekKo TYPE STANDARD TABLE OF st_ekko,

wa_ekKo TYPE st_ekko,

it_fieldcat TYPE slis_t_fieldcat_alv,

wa_fieldcat TYPE slis_fieldcat_alv.

DATA : v_ebeln TYPE ekko-ebeln.

SELECT-OPTIONS: so_ebeln FOR v_ebeln OBLIGATORY.

START-OF-SELECTION.

SELECT ebeln bstyp bsart aedat ernam

FROM ekko

INTO TABLE it_ekko

WHERE ebeln IN so_ebeln.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = sy-repid

I_INTERNAL_TABNAME = 'IT_EKKO'

*I_STRUCTURE_NAME = 'ST_EKKO'

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = sy-repid

  • I_BYPASSING_BUFFER = I_BYPASSING_BUFFER

  • I_BUFFER_ACTIVE = I_BUFFER_ACTIVE

CHANGING

ct_fieldcat = it_fieldcat

  • EXCEPTIONS

  • INCONSISTENT_INTERFACE = 1

  • PROGRAM_ERROR = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

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

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

ENDIF.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = I_BYPASSING_BUFFER

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = sy-repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME = I_STRUCTURE_NAME

  • IS_LAYOUT = IS_LAYOUT

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING = IT_EXCLUDING

  • IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS

  • IT_SORT = IT_SORT

  • IT_FILTER = IT_FILTER

  • IS_SEL_HIDE = IS_SEL_HIDE

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT = IS_VARIANT

  • IT_EVENTS = IT_EVENTS

  • IT_EVENT_EXIT = IT_EVENT_EXIT

  • IS_PRINT = IS_PRINT

  • IS_REPREP_ID = IS_REPREP_ID

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IR_SALV_LIST_ADAPTER = IR_SALV_LIST_ADAPTER

  • IT_EXCEPT_QINFO = IT_EXCEPT_QINFO

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER

  • ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER

TABLES

t_outtab = it_ekko

  • * 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.

THIS IS MY CODE HELP ME IN FINDING THE SOLUTION FOR THIS PGM WHERE I M GETTING ERROR FIELD CATALOG NOT FOUND

I WILL REWARD POINTS IF I GET THE OUTPUT

THANXS IN ADVANCE

Edited by: Nandini P on Jan 9, 2008 10:26 AM

Edited by: Nandini P on Jan 9, 2008 10:26 AM

11 REPLIES 11
Read only

Former Member
0 Likes
1,538

u r passing this structure 'ST_EKKO' for creating field catlaogue.

first check whether u r system is having this structure or not

Madahvi

Read only

0 Likes
1,538

i have given the name of the structure which i have created and as we know we can pass either structure name or internal table name and it was just a trial giving both structure and table name

Read only

Former Member
0 Likes
1,538

Hi Nandani,

AS I had replied yesterday -- Please use IT_EKPO both in structure as well as internal table name..

Instead of passing sy-repid directly as parameter..define as following

data : progname type TRDIR-NAME.

progname = sy-repid.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = progname

I_INTERNAL_TABNAME = 'IT_EKKO'

I_STRUCTURE_NAME = 'IT_EKKO*'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = sy-repid

I_BYPASSING_BUFFER = I_BYPASSING_BUFFER

I_BUFFER_ACTIVE = I_BUFFER_ACTIVE

CHANGING

ct_fieldcat = it_fieldcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

Regards,

Mohaiyuddin

Read only

0 Likes
1,538

i have done the same thing which u have said me it is not working and even with passing body of the field catalog

Read only

Former Member
0 Likes
1,538

Hi,

Try this code u have to keep [] after it_fieldcat

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

CHANGING

ct_fieldcat = it_fieldcat[]

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

IF sy-subrc 0.

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

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

ENDIF.

Plzz reward points if it helps.

Read only

Former Member
0 Likes
1,538

Dear Madhavi,

If you are using the function module 'REUSE_ALV_FIELDCATALOG_MERGE', then use the structure 'st_ekko'. As per your code you have declared the structure but you did not use it in this function module.

Kindly check the code.

*I_STRUCTURE_NAME = 'ST_EKKO'

Kindly make it uncomment.

Then check the result.

Thanks And Regards

Y Venkateswar Reddy

Read only

0 Likes
1,538

i have used it i have passed both internal table as well as structure name i have tried first giving internal table name only then with structure and then with structure and internal name it is not executing

Read only

0 Likes
1,538

Hi Nandini,

I also tried the code, but it's not working..

I even tried to shift ST_EKKO in different include - still not working.

Best way is to manually fill fieldcatalog, as you are not having too many fields.

Regards,

Mohaiyuddin

Read only

Former Member
0 Likes
1,538

hi,

pass body of fieldcatalog as follows:

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_INTERFACE_CHECK = ' '

I_BYPASSING_BUFFER = I_BYPASSING_BUFFER

I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = sy-repid

I_CALLBACK_PF_STATUS_SET = ' '

I_CALLBACK_USER_COMMAND = ' '

I_STRUCTURE_NAME = I_STRUCTURE_NAME

IS_LAYOUT = IS_LAYOUT

IT_FIELDCAT = IT_FIELDCAT[] (not it_fieldcat)

Reward points if useful

Regards,

Nishant

Read only

Former Member
0 Likes
1,538

Hi,

Create a strcuture in SE11 and use the structure in Fieldcatalog merge FM to build fieldcatalog.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,538

Hi Nandini,

to the FM 'REUSE_ALV_FIELDCATALOG_MERGE

you are trying to pass an internal table defined as

DATA : it_ekKo TYPE STANDARD TABLE OF st_ekko,

if i am not wrong while creating field catlog u'll get an error if u use internal tables with type reerence..

so...............

option one:try to create an internal table

data: begin of it_ekko occurs 0,

ebeln like ekko-ebeln,

and o on...

dont use any TYPE reference.

end of it_ekko.

option 2: create a structure in the dictionary and pass the structure to the FM.