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 Report Problem

Former Member
0 Likes
789

Hi Expert,

I have a question of alv report.Actually I am making a zscreen and zreport for form38. In main screen there is three pushbutton- Create, change and display. there is new screen for every pushbutton like screen 201, 202,203 for create,change,display.when click on create 202 screen is call. in this screen there is 4 field- vendor-code, form38 no, date,remark. when user give vendor code and click on create button that time i want a new screen.in this new scree want to display all form 38 no for that vendor code. Below is the print screen.

This is the main screen.

when i give vendor code and click on create that a new srcreen appear in new scree want to display only all form 38 no for same vendor.

Please guide me expert.....

Thanks & Regards

Atin

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
760

I got the solution. Given is the code.

FORM GET_DATA .

SELECT * FROM zform38no INTO TABLE GT_OUTTAB WHERE vencode in vencode.

*                                                   and dateiss in dateiss.

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'

       EXPORTING

            I_STRUCTURE_NAME       = 'ZFORM38NO'

       changing

            ct_fieldcat            =  gt_fieldcat[].

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

        EXPORTING

             I_TITLE                 = vencode-low

*           I_SELECTION             = 'X'

*           I_ZEBRA                 = ' '

*           I_SCREEN_START_COLUMN   = 0

*           I_SCREEN_START_LINE     = 0

*           I_SCREEN_END_COLUMN     = 0

*           I_SCREEN_END_LINE       = 0

*           I_CHECKBOX_FIELDNAME    =

*           I_LINEMARK_FIELDNAME    =

*           I_SCROLL_TO_SEL_LINE    = 'X'

             i_tabname               = '1'

             IT_FIELDCAT             = gt_fieldcat[]

*           IT_EXCLUDING            =

*           I_CALLBACK_PROGRAM      =

*           I_CALLBACK_USER_COMMAND =

             IS_PRIVATE              = GS_PRIVATE

      IMPORTING

             ES_SELFIELD             = GS_SELFIELD

             E_EXIT                  = G_EXIT

        TABLES

             T_OUTTAB                = GT_OUTTAB

        EXCEPTIONS

             PROGRAM_ERROR           = 1

             OTHERS                  = 2.

   IF SY-SUBRC <> 0.

     MESSAGE I000(0K) WITH SY-SUBRC.

   ENDIF.

   form = gs_selfield-VALUE.

ENDFORM.                    " GET_DATA

4 REPLIES 4
Read only

sivaganesh_krishnan
Contributor
0 Likes
760

Hi atin,

why are you having initial screen with three buttons.. Instead you can create three individual reports and create transactions for it . And then create Area Menu For displaying these report as your first screen.

And In the creation part .. I cant able to understand clearly ? Can you explain what exactly you want in creation mode.

Regards,

Sivaganesh

Read only

0 Likes
760

Hi Atin,

Check sy-ucomm for the second 'create' push button. Since you have two create buttons.

Read only

dibyajeeban_jena
Active Participant
0 Likes
760

Hi,

What is the problem u r facing ? On the second screen , when u r pressing create , check the function code for the Create button on 202 screen  in PAI  and write the code for calling another screen and displaying  vendor/form38 no in a table control .

If u want  F4 help on vendor code ,that will show  all the form38 no for the same vendor code . then u go for FM -

'F4IF_INT_TABLE_VALUE_REQUEST'

Regards

DJ

Read only

Former Member
0 Likes
761

I got the solution. Given is the code.

FORM GET_DATA .

SELECT * FROM zform38no INTO TABLE GT_OUTTAB WHERE vencode in vencode.

*                                                   and dateiss in dateiss.

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'

       EXPORTING

            I_STRUCTURE_NAME       = 'ZFORM38NO'

       changing

            ct_fieldcat            =  gt_fieldcat[].

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

        EXPORTING

             I_TITLE                 = vencode-low

*           I_SELECTION             = 'X'

*           I_ZEBRA                 = ' '

*           I_SCREEN_START_COLUMN   = 0

*           I_SCREEN_START_LINE     = 0

*           I_SCREEN_END_COLUMN     = 0

*           I_SCREEN_END_LINE       = 0

*           I_CHECKBOX_FIELDNAME    =

*           I_LINEMARK_FIELDNAME    =

*           I_SCROLL_TO_SEL_LINE    = 'X'

             i_tabname               = '1'

             IT_FIELDCAT             = gt_fieldcat[]

*           IT_EXCLUDING            =

*           I_CALLBACK_PROGRAM      =

*           I_CALLBACK_USER_COMMAND =

             IS_PRIVATE              = GS_PRIVATE

      IMPORTING

             ES_SELFIELD             = GS_SELFIELD

             E_EXIT                  = G_EXIT

        TABLES

             T_OUTTAB                = GT_OUTTAB

        EXCEPTIONS

             PROGRAM_ERROR           = 1

             OTHERS                  = 2.

   IF SY-SUBRC <> 0.

     MESSAGE I000(0K) WITH SY-SUBRC.

   ENDIF.

   form = gs_selfield-VALUE.

ENDFORM.                    " GET_DATA