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: 

Problem using Field symbols

Former Member
0 Kudos

Hi All,

We have recently upgraded to ECC6.0 and one of the zprogram is giving dump now. Previously with 4.6C it was working fine. Can someone please help me.

I researched prvious posts but did not find any answer.

Thanks,

Veni.

Runtime Errors GETWA_NOT_ASSIGNED

Short text

Field symbol has not yet been assigned.

What happened?

Error in the ABAP Application Program

The current ABAP program "SAPLKKBL" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

----


  • FORM GEN_FIELD_OUT2 *

----


  • ........ *

----


form gen_field_out2.

field-symbols <l_initial>.

case gs_out-field_colcount.

when 001.

if gs_out_flags-slave ne 'X'.

>>>> assign <fm01> to <field>.

gs_fc = gs_mfc01.

else.

assign <fs01> to <field>.

gs_fc = gs_sfc01.

endif.

when 002.

if gs_out_flags-slave ne 'X'.

assign <fm02> to <field>.

gs_fc = gs_mfc02.

else.

assign <fs02> to <field>.

gs_fc = gs_sfc02.

endif.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I would do the following...

**Comment the checkbox column in the field catalog.
**Add checkbox to the Field Catalog
*    CLEAR w_fieldcat.
*    w_fieldcat-fieldname = 'CHECKBOX'.
*    w_fieldcat-checkbox = 'X'.
*    w_fieldcat-key = 'X'.
*    w_fieldcat-outputlen = 2.
*    w_fieldcat-seltext_l = 'Selection Indicator'.
*    w_fieldcat-col_pos = 1.
*    w_fieldcat-edit = 'X'.
*    APPEND w_fieldcat TO t_fieldcat.                        " index 1.

** Add the checkbox as the box field name in the layout.
  g_layout-box_fieldname = 'CHECKBOX'.

Thanks

Naren

16 REPLIES 16

Former Member
0 Kudos

You are assigning a field symbold that is not assigned in the first place.

That's what you need to find out, why is that field symbols never assigned

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Looks like this is coming from the ALV call. This commonly happens when you specify a field in the field catalog, that does not have a corresponding field in the internal table which is used in the ALV grid. Check to make sure that all fields in your field catalog have a corresponding field in the internal table, and that it is they are spelled correctly.

Regards,

Rich Heilman

david_carballido
Active Participant
0 Kudos

When you field symbols is unassign, sy-subrc is different 0 ... try ...

ASSIGN g_var TO <fs_var>.

IF sy-subrc = 0.

... LOGIC

ASSIGN <fs_var> TO <fs_var2>.

IF sy-subrc = 0.

... logic

ENDIF.

ENDIF.

David Carballido ^^

0 Kudos

Hi All,

The error is comming from include 'LKKBLF99'. In my program it is comming when executing the function 'REUSE_ALV_LIST_DISPLAY'. Can someone please help me with the error.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = g_repid

i_callback_pf_status_set = g_status

i_callback_user_command = g_user_command

is_layout = g_layout

it_sort = t_sortcat

i_default = 'A'

i_save = 'A'

is_variant = g_variant

it_fieldcat = t_fieldcat[]

it_events = t_alv_events[]

is_print = print

TABLES

t_outtab = itab

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.

Runtime Errors GETWA_NOT_ASSIGNED

Short text

Field symbol has not yet been assigned.

What happened?

Error in the ABAP Application Program

The current ABAP program "SAPLKKBL" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

Error analysis

You attempted to access an unassigned field symbol

(data segment 92).

This error may occur if

- You address a typed field symbol before it has been set with

ASSIGN

- You address a field symbol that pointed to the line of an

internal table that was deleted

- You address a field symbol that was previously reset using

UNASSIGN or that pointed to a local field that no

longer exists

- You address a global function interface, although the

respective function module is not active - that is, is

not in the list of active calls. The list of active calls

can be taken from this short dump.

Trigger Location of Runtime Error

Program SAPLKKBL

Include LKKBLF99

Row 2,796

Module type (FORM)

Module Name GEN_FIELD_OUT2

2785 ----


2786 * FORM GEN_FIELD_OUT2 *

2787 ----


2788 * ........ *

2789 ----


2790 form gen_field_out2.

2791 field-symbols <l_initial>.

2792

2793 case gs_out-field_colcount.

2794 when 001.

2795 if gs_out_flags-slave ne 'X'.

>>>>> assign <fm01> to <field>.

2797 gs_fc = gs_mfc01.

2798 else.

2799 assign <fs01> to <field>.

2800 gs_fc = gs_sfc01.

2801 endif.

2802 when 002.

2803 if gs_out_flags-slave ne 'X'.

2804 assign <fm02> to <field>.

2805 gs_fc = gs_mfc02.

2806 else.

2807 assign <fs02> to <field>.

2808 gs_fc = gs_sfc02.

2809 endif.

Thanks,

Veni.

0 Kudos

Follow Rich's suggestions.

IF you see the assignment of <fm01>.


assign component gs_out_fieldcat-fieldname
             of structure t_outtab_master to <fm01>.

There is something wrong between your field catalog and your internal table. Maybe something changed in the update

Former Member
0 Kudos

Hi Venni,

This is problem regrading fieldcatlog. this type of error usually not come in grid alv it only comes inalv list

Analysing your program dump i think the problem is, the fieldcatlog of one of your field(which you want to display) in alv list has given reference table name but i think for that field no reference table exist.

so what it is trying to get output length to display. but the field symbol is not assigned so it giving a short dump.

Hopefully it will definitely solve your problem..

Thanks,

Nitin

0 Kudos

Hi All,

I still did not find any solution for the problem. Why program name and include name are assigning to same g_repid. I debuged it and for both program name only comming. Is this the problem. This report was workin fine in 4.6c but dumps in ECC6.0.

Can someone please help me with it.

Thanks,

Veni.

DATA: BEGIN OF itab OCCURS 100,

kunnr LIKE vbpa-kunnr,

name1 LIKE kna1-name1,

netwr LIKE vbrp-netwr,

kbetr LIKE konp-kbetr,

cnetwr LIKE vbrp-netwr,

adjust(12) TYPE c,

mnetwr LIKE vbrp-netwr,

wrbtr LIKE bseg-wrbtr,

owrbtr LIKE bseg-wrbtr,

ualloc LIKE bseg-wrbtr,

twrbtr LIKE bseg-wrbtr,

texcess LIKE bseg-wrbtr,

treserve LIKE bseg-wrbtr,

END OF itab.

TYPE-POOLS: slis.

DATA : print TYPE slis_print_alv, "Printer settings

g_repid LIKE sy-repid, "Program calling ALV

t_fieldcat TYPE slis_t_fieldcat_alv, "ALV FieldCatalog

g_layout TYPE slis_layout_alv, "Layout for ALV

w_fieldcat LIKE LINE OF t_fieldcat, "ALV FieldCat WorkArea

t_alv_headers TYPE slis_t_listheader, "ALV headers

t_alv_events TYPE slis_t_event WITH HEADER LINE,

t_sortcat TYPE slis_t_sortinfo_alv,

g_variant LIKE disvariant,

g_filter TYPE slis_t_filter_alv,

g_status type slis_formname value 'STANDARD_02',

G_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND',

w_sortcat_ln LIKE LINE OF t_sortcat.

FORM alv_output.

clear t_fieldcat.

refresh t_fieldcat.

clear pfkey.

g_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

i_internal_tabname = 'ITAB'

i_inclname = g_repid

CHANGING

ct_fieldcat = t_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.

EXIT.

ELSE.

CLEAR w_fieldcat-key.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING key WHERE key = 'X'.

*Add checkbox to the Field Catalog

CLEAR w_fieldcat.

w_fieldcat-fieldname = 'CHECKBOX'.

w_fieldcat-checkbox = 'X'.

w_fieldcat-key = 'X'.

w_fieldcat-outputlen = 2.

w_fieldcat-seltext_l = 'Selection Indicator'.

w_fieldcat-col_pos = 1.

w_fieldcat-edit = 'X'.

APPEND w_fieldcat TO t_fieldcat. " index 1.

CLEAR w_fieldcat.

*Add the right descriptions

w_fieldcat-col_pos = 2.

modify t_fieldcat from w_fieldcat transporting col_pos

where fieldname = 'KUNNR'.

clear w_fieldcat.

w_fieldcat-seltext_l = 'Customer Name'.

w_fieldcat-col_pos = 3.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'NAME1'.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 4.

w_fieldcat-seltext_l = 'Gross Co-op Sales'.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'NETWR'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Accrual Rate(%)'.

w_fieldcat-col_pos = 5.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'KBETR'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Credits Accrued'.

w_fieldcat-col_pos = 6.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'CNETWR'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Adjustments'.

w_fieldcat-col_pos = 7.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'ADJUST'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Max.Allowable Credits'.

w_fieldcat-col_pos = 8.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'MNETWR'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Credits Issued'.

w_fieldcat-col_pos = 9.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'WRBTR'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Chargebacks Outstanding'.

w_fieldcat-seltext_m = 'Outstanding'.

w_fieldcat-col_pos = 10.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

seltext_m WHERE fieldname = 'OWRBTR'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Unallocate Chargebacks'.

w_fieldcat-seltext_m = 'Unallocated'.

w_fieldcat-col_pos = 11.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

seltext_m WHERE fieldname = 'UALLOC'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Total Charges'.

w_fieldcat-col_pos = 12.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'TWRBTR'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Excess Credits Issued'.

w_fieldcat-seltext_m = 'Excess Credit'.

w_fieldcat-col_pos = 13.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

seltext_m WHERE fieldname = 'TEXCESS'.

CLEAR w_fieldcat.

w_fieldcat-seltext_l = 'Reserve Remaining'.

w_fieldcat-seltext_m = 'Res. Remaining'.

w_fieldcat-col_pos = 14.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

seltext_m WHERE fieldname = 'TRESERVE'.

CLEAR w_fieldcat.

ENDIF.

g_variant-report = g_repid.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = g_repid

i_callback_pf_status_set = g_status

i_callback_user_command = g_user_command

is_layout = g_layout

it_sort = t_sortcat

i_default = 'A'

i_save = 'A'

is_variant = g_variant

it_fieldcat = t_fieldcat[]

it_events = t_alv_events[]

is_print = print

TABLES

t_outtab = itab

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.

ENDFORM. " alv_output

0 Kudos

Any help please...

Thanks,

Veni.

Former Member
0 Kudos

Hi,

I tried your code in my system (ECC 6.0) ...I am not getting any dump..is it during display or after that...please explain

DATA: BEGIN OF itab OCCURS 100,
kunnr LIKE vbpa-kunnr,
name1 LIKE kna1-name1,
netwr LIKE vbrp-netwr,
kbetr LIKE konp-kbetr,
cnetwr LIKE vbrp-netwr,
adjust(12) TYPE c,
mnetwr LIKE vbrp-netwr,
wrbtr LIKE bseg-wrbtr,
owrbtr LIKE bseg-wrbtr,
ualloc LIKE bseg-wrbtr,
twrbtr LIKE bseg-wrbtr,
texcess LIKE bseg-wrbtr,
treserve LIKE bseg-wrbtr,
END OF itab.

TYPE-POOLS: slis.
DATA : print TYPE slis_print_alv, "Printer settings
g_repid LIKE sy-repid, "Program calling ALV
t_fieldcat TYPE slis_t_fieldcat_alv, "ALV FieldCatalog
g_layout TYPE slis_layout_alv, "Layout for ALV
w_fieldcat LIKE LINE OF t_fieldcat, "ALV FieldCat WorkArea
t_alv_headers TYPE slis_t_listheader, "ALV headers
t_alv_events TYPE slis_t_event WITH HEADER LINE,
t_sortcat TYPE slis_t_sortinfo_alv,
g_variant LIKE disvariant,
g_filter TYPE slis_t_filter_alv,
g_status TYPE slis_formname VALUE 'STANDARD_02',
g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
w_sortcat_ln LIKE LINE OF t_sortcat.

PERFORM alv_output.

*&---------------------------------------------------------------------*
*&      Form  alv_output
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM alv_output.
  CLEAR t_fieldcat.
  REFRESH t_fieldcat.
  g_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = g_repid
      i_internal_tabname     = 'ITAB'
      i_inclname             = g_repid
    CHANGING
      ct_fieldcat            = t_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.
    EXIT.
  ELSE.
    CLEAR w_fieldcat-key.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING key WHERE key = 'X'.

*Add checkbox to the Field Catalog
    CLEAR w_fieldcat.
    w_fieldcat-fieldname = 'CHECKBOX'.
    w_fieldcat-checkbox = 'X'.
    w_fieldcat-key = 'X'.
    w_fieldcat-outputlen = 2.
    w_fieldcat-seltext_l = 'Selection Indicator'.
    w_fieldcat-col_pos = 1.
    w_fieldcat-edit = 'X'.
    APPEND w_fieldcat TO t_fieldcat.                        " index 1.
    CLEAR w_fieldcat.
*Add the right descriptions
    w_fieldcat-col_pos = 2.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING col_pos
    WHERE fieldname = 'KUNNR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Customer Name'.
    w_fieldcat-col_pos = 3.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'NAME1'.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 4.
    w_fieldcat-seltext_l = 'Gross Co-op Sales'.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'NETWR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Accrual Rate(%)'.
    w_fieldcat-col_pos = 5.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'KBETR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Credits Accrued'.
    w_fieldcat-col_pos = 6.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'CNETWR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Adjustments'.
    w_fieldcat-col_pos = 7.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'ADJUST'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Max.Allowable Credits'.
    w_fieldcat-col_pos = 8.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'MNETWR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Credits Issued'.
    w_fieldcat-col_pos = 9.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'WRBTR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Chargebacks Outstanding'.
    w_fieldcat-seltext_m = 'Outstanding'.
    w_fieldcat-col_pos = 10.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    seltext_m WHERE fieldname = 'OWRBTR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Unallocate Chargebacks'.
    w_fieldcat-seltext_m = 'Unallocated'.
    w_fieldcat-col_pos = 11.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    seltext_m WHERE fieldname = 'UALLOC'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Total Charges'.
    w_fieldcat-col_pos = 12.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    WHERE fieldname = 'TWRBTR'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Excess Credits Issued'.
    w_fieldcat-seltext_m = 'Excess Credit'.
    w_fieldcat-col_pos = 13.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    seltext_m WHERE fieldname = 'TEXCESS'.
    CLEAR w_fieldcat.
    w_fieldcat-seltext_l = 'Reserve Remaining'.
    w_fieldcat-seltext_m = 'Res. Remaining'.
    w_fieldcat-col_pos = 14.
    MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos
    seltext_m WHERE fieldname = 'TRESERVE'.
    CLEAR w_fieldcat.
  ENDIF.
  g_variant-report = g_repid.
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program       = g_repid
      i_callback_pf_status_set = g_status
      i_callback_user_command  = g_user_command
      is_layout                = g_layout
      it_sort                  = t_sortcat
      i_default                = 'A'
      i_save                   = 'A'
      is_variant               = g_variant
      it_fieldcat              = t_fieldcat[]
      it_events                = t_alv_events[]
      is_print                 = print
    TABLES
      t_outtab                 = itab
    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.


ENDFORM. " alv_output

Thanks

Naren

0 Kudos

Hi Naren,

It is during display only. After giving selection screen parameters, when I execute it is giving me dump.

Thanks,

Veni.

Edited by: veni reddy on Sep 18, 2008 10:49 PM

Former Member
0 Kudos

Hi,

Try this..add the CHECKBOX field to the internal table declaration..as you have added in your field catalog..

DATA: BEGIN OF itab OCCURS 100,
kunnr LIKE vbpa-kunnr,
name1 LIKE kna1-name1,
netwr LIKE vbrp-netwr,
kbetr LIKE konp-kbetr,
cnetwr LIKE vbrp-netwr,
adjust(12) TYPE c,
mnetwr LIKE vbrp-netwr,
wrbtr LIKE bseg-wrbtr,
owrbtr LIKE bseg-wrbtr,
ualloc LIKE bseg-wrbtr,
twrbtr LIKE bseg-wrbtr,
texcess LIKE bseg-wrbtr,
treserve LIKE bseg-wrbtr,
CHECKBOX TYPE char1,             " Code added.
END OF itab.

Thanks

Naren

0 Kudos

Hi Naren,

I added the checkbox to ITAB. Should I change any thing in w_fieldcat,

w_fieldcat-fieldname = 'CHECKBOX'. "CHECKBOX

w_fieldcat-checkbox = 'X'.

w_fieldcat-key = 'X'.

w_fieldcat-outputlen = 2.

w_fieldcat-seltext_l = 'Selection Indicator'.

w_fieldcat-col_pos = 1.

w_fieldcat-edit = 'X'.

APPEND w_fieldcat TO t_fieldcat. " index 1.

CLEAR w_fieldcat.

Thanks,

Veni.

Former Member
0 Kudos

Hi,

I would do the following...

**Comment the checkbox column in the field catalog.
**Add checkbox to the Field Catalog
*    CLEAR w_fieldcat.
*    w_fieldcat-fieldname = 'CHECKBOX'.
*    w_fieldcat-checkbox = 'X'.
*    w_fieldcat-key = 'X'.
*    w_fieldcat-outputlen = 2.
*    w_fieldcat-seltext_l = 'Selection Indicator'.
*    w_fieldcat-col_pos = 1.
*    w_fieldcat-edit = 'X'.
*    APPEND w_fieldcat TO t_fieldcat.                        " index 1.

** Add the checkbox as the box field name in the layout.
  g_layout-box_fieldname = 'CHECKBOX'.

Thanks

Naren

0 Kudos

Hi Naren,

Thankyou very much. Now no dump, it is giving me output. But after the output not able to get the checked records.

This is the modified code. Anything should I change.

FORM alv_output.

clear t_fieldcat.

refresh t_fieldcat.

clear pfkey.

g_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

i_internal_tabname = 'ITAB'

i_inclname = g_repid

CHANGING

ct_fieldcat = t_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.

EXIT.

ELSE.

CLEAR w_fieldcat-key.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING key WHERE key = 'X'.

CLEAR w_fieldcat.

**Comment the checkbox column in the field catalog.

**Add checkbox to the Field Catalog

  • w_fieldcat-fieldname = 'CHECKBOX'. "CHECKBOX

  • w_fieldcat-checkbox = 'X'.

  • w_fieldcat-key = 'X'.

  • w_fieldcat-outputlen = 2.

  • w_fieldcat-seltext_l = 'Selection Indicator'.

  • w_fieldcat-col_pos = 1.

  • w_fieldcat-edit = 'X'.

  • APPEND w_fieldcat TO t_fieldcat. " index 1.

  • CLEAR w_fieldcat.

    • Add the checkbox as the box field name in the layout.

g_layout-box_fieldname = 'CHECKBOX'.

*Add the right descriptions

w_fieldcat-col_pos = 2.

modify t_fieldcat from w_fieldcat transporting col_pos

where fieldname = 'KUNNR'.

clear w_fieldcat.

w_fieldcat-seltext_l = 'Customer Name'.

w_fieldcat-col_pos = 3.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'NAME1'.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 4.

w_fieldcat-seltext_l = 'Net Sales'.

MODIFY t_fieldcat FROM w_fieldcat TRANSPORTING seltext_l col_pos

WHERE fieldname = 'NETWR'.

CLEAR w_fieldcat.

Thanks,

Veni.

Former Member
0 Kudos

Hi,

In the user command subroutine just loop at the internal table ITAB ...WHERE CHECKBOX = 'X'...to get the records that are checked..

Thanks

Naren

0 Kudos

Hi Naren,

It was not reading the Custnum properly. I fixed it now and working fine. I really appriciate all your help.

  • move sy-lisel+4(14) to ftab-kunnr.

move sy-lisel+3(13) to ftab-kunnr.

Thanks,

Veni.

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

pfkey = sy-pfkey.

clear sy-pfkey.

case r_ucomm.

WHEN 'SALE'.

SET PF-STATUS 'NORM1'.

PERFORM display_data.

CLEAR: vbpa, vbrk.

LOOP AT ftab.

IF ftab-ind = 'X'.

SKIP.

ULINE (33).

FORMAT COLOR COL_HEADING ON.

WRITE: /01 sy-vline,

02 'Sales for Customer:', ftab-kunnr, sy-vline.

.............

.............

FORM display_data.

cnt1 = 4.

ipage = 1.

  • move sy-lisel+4(14) to ftab-kunnr.

move sy-lisel+3(13) to ftab-kunnr.

ftab-ind = 'X'.

append ftab.

CLEAR ftab.

ENDFORM. "display_data