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

Report for Table maintenance screen

Former Member
5,606

Hi experts,

i need to create a report , in selection screen user pass the value for input filed and it should call the table maintenance screen with required entries.

i have already created table with table mainatance genaratior .

please let me know how can i display the table maintenance screen using report/

Thanks in adavance

Regards

Neeru

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,525

Hi Niru,

What is the view name you created for the table.Pass the view name here.

Regards,

Kannan

Hi experts,

i need to create a report , in selection screen user pass the value for input filed and it should call the table maintenance screen with required entries.

i have already created table with table mainatance genaratior .

please let me know how can i display the table maintenance screen using report/

Thanks in adavance

Regards

Neeru

12 REPLIES 12
Read only

Former Member
0 Likes
3,525

Have you created a parameter transaction for SM30 and your table?

Rob

Read only

0 Likes
3,525

Yes, I have creted the tocde for SM 30 table , my requirement is to create the report with selection screen , if you used pass the input ...report should display the table maintanace screen with required entries

thanks

neeru

Read only

0 Likes
3,525

Hi Niru,


I believe it's easier if you actually build a module pool program with a table grid to display/change the required data.



I don't know if this is valid, but check the link I found:

<a href="https://answers.sap.com/docs/DOC-45561" title="http://scn.sap.com/docs/DOC-45561">http://scn.sap.com/docs/DOC-45561</a>



Thales Schmidt

Read only

0 Likes
3,525

Hi Niru,

maybe an easier way to achieve your requirement is to create a view with the same fields you have in your table.

But, set the parameter Maintenance attribute with S for all fields you want do restrict.

Then, create your table maintenance for this view.

Regards,

Frisoni

Read only

Former Member
0 Likes
3,525

Hi Niru,

Follow these steps.

1.Create a table maintenance generator as per your requirement.

2.Design your selection screen based on the entries you want to add.

3.Call FMs View Maintenance FM to generate the view.

Make use of the following code ...

*&---------------------------------------------------------------------*

*& Report  ZSCN

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZSCN.

TABLES: ztest.

CONSTANTS: c_view  TYPE   char30  VALUE 'ZTEST',

            c_u     TYPE   char1   VALUE 'U',

            c_and   TYPE   char3   VALUE 'AND'.

DATA: gt_seltab    TYPE STANDARD TABLE OF vimsellist.

DATA: g_fieldname  TYPE vimsellist-viewfield.

DATA: gt_exclude   TYPE TABLE OF vimexclfun,

       gwa_exclude  TYPE vimexclfun.

SELECT-OPTIONS: s_id    FOR ztest-id,

                 s_name  FOR ztest-name,

                 s_job FOR ztest-job.

*Add ID column to selection criteria of Table maintenanace view

g_fieldname = 'ID'.

CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

   EXPORTING

     fieldname          = g_fieldname

     append_conjunction = c_and

   TABLES

     sellist            = gt_seltab

     rangetab           = s_id.

*Add Name column to selection criteria of Table maintenanace view

g_fieldname = 'NAME'.

CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

   EXPORTING

     fieldname          = g_fieldname

     append_conjunction = c_and

   TABLES

     sellist            = gt_seltab

     rangetab           = s_name.

*Add Place column to selection criteria of Table maintenanace view

g_fieldname = 'JOB'.

CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

   EXPORTING

     fieldname          = g_fieldname

     append_conjunction = c_and

   TABLES

     sellist            = gt_seltab

     rangetab           = s_place.

* Call to the 'VIEW_MAINTENANCE_CALL' function module

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

   EXPORTING

     action         = c_u

     view_name      = c_view

   TABLES

     dba_sellist    = gt_seltab.



Hope it helps.


Regards,

Kannan

Read only

0 Likes
3,525

Thanks all for your replies..i have written the report

START-OF-SELECTION.

*  DEFINE addsel.

     CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

       EXPORTING

         fieldname          = gv_fieldname

         append_conjunction = 'AND'

       TABLES

         sellist            = gt_selection

         rangetab           = s_charc.

     CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

       EXPORTING

         fieldname          = gv_fieldname

         append_conjunction = 'AND'

       TABLES

         sellist            = gt_selection

         rangetab           = s_fbtyp.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

     EXPORTING

       ACTION                = 'U'

       VIEW_NAME             = 'ZKT_AlLOCATION''

       complex_selconds_used = 'X'

     TABLES

       DBA_SELLIST           = gt_selection.

   IF SY-SUBRC <> 0.

* Implement suitable error handling here

   ENDIF.

once i excute iam getting the below run time error.

Error analysis

    An exception occurred that is explained in detail below.

    The exception, which is assigned to class 'CX_SY_RANGE_OUT_OF_BOUNDS', wa

     caught in

    procedure "TRANSLATE_SELLIST_TO_WHERETAB" "(FORM)", nor was it propagated

     RAISING clause.

    Since the caller of the procedure could not have anticipated that the

    exception would occur, the current program is terminated.

    The reason for the exception is:

    In the executed program "SAPLSVIX", the system attempted to access the fi

    "TSTW_CLAUSE-VALUE-VALUE" using the length 0.

    However, a partial field access with the length specification 0 is not

    allowed.

for VIEW_NAME filed i have paased the table name ..is the error because of this issue?

Thanks

neeru

Read only

Former Member
0 Likes
3,525

Hy Niru,

I think the better way is to create a Cluster View, like a standard works. Follow link that can help you

SAPTechnical.COM - Creation of a View cluster

Regards,

Bruno

Read only

Former Member
0 Likes
3,526

Hi Niru,

What is the view name you created for the table.Pass the view name here.

Regards,

Kannan

Read only

0 Likes
3,525

Hi kannan

i have tried with view /Table name ..but facing the similar issue.

pasing two fileds in selection screen but  table contain total 10 fileds

my code is as below.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.

*characterstic

SELECT-OPTIONS: s_charc for gv_character.

*Form Bundle type

SELECT-OPTIONS: s_fbtyp for gv_fbtyp.

SELECTION-SCREEN END OF BLOCK b1.

*----------------------------------------------------------------------*

*   S T A R T   O F   S E L E C T I O N                                *

*----------------------------------------------------------------------*

START-OF-SELECTION.

*  DEFINE addsel.

     CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

       EXPORTING

         fieldname          = gv_fieldname

         append_conjunction = 'AND'

       TABLES

         sellist            = gt_selection

         rangetab           = s_charc.

     CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

       EXPORTING

         fieldname          = gv_fieldname

         append_conjunction = 'AND'

       TABLES

         sellist            = gt_selection

         rangetab           = s_fbtyp.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

     EXPORTING

       ACTION                = 'U'

       VIEW_NAME             = 'ZKR_ALLOCATE'

       complex_selconds_used = 'X'

     TABLES

       DBA_SELLIST           = gt_selection.

   IF SY-SUBRC <> 0.

* Implement suitable error handling here

   ENDIF.


regards

neeru

Read only

0 Likes
3,525

Hi Niru,

Pass your fields like

g_fieldname = 'ID'.

CALL FUNCTION 'VIEW_RANGETAB_TO_SELLIST'

   EXPORTING

     fieldname          = g_fieldname

     append_conjunction = c_and

   TABLES

     sellist            = gt_seltab

     rangetab           = s_id.


Pass your fieldname.It will work.and call the FM after every assignment.


Regards,

Kannan

Read only

0 Likes
3,525

Hi kannan,

"ID"  means name of filed of table?

the FM "VIEW_RANGETAB_TO_SELLIST"   needs to call for the selction screen fileds or all the ten fileds in table ?

Thanks

neeru

Read only

0 Likes
3,525

Hi Niru,

You need to pass the 10 fields separately."ID" is one of the field in my table.What all the screen you want to display in the output.Pass those.

Regards,

Kannan