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: 

More than 10 entry in one field in selection-screen. ?

Former Member
0 Kudos

Hi expert,

I want to add 2 field like 1-sr.no and 2-form-38 number in selection-screen in create section. want to both new field like drop down where user can input 1 to 15 value at one time. I need your help Please guide me expert.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Any one hare.....Who can give the solution plz???????????

20 REPLIES 20

dibyajeeban_jena
Active Participant
0 Kudos

Hi,

can u explain a bit more, how exactly u want your selection screen..

i assume ..

SR NO                       Form38

     1                               F1

    2                                F2

...

...

...

   15                               F15

is it so ?

Regards

0 Kudos

Yes..like it..but want to fill this value by user manually..

Former Member
0 Kudos

Any one hare.....Who can give the solution plz???????????

0 Kudos

Hi,

Follow below code...and corresponding output.  i have done like this before

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

SELECTION-SCREEN COMMENT /16(7)
                          text-001 .

SELECTION-SCREEN COMMENT 24(10)
                          text-002 .

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO1 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO1 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO2 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO2 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO3 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO3 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO4 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO4 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO5 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO5 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO6 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO6 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO7 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS : FORMNO7 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO8 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO8 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO9 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO9 TYPE c LENGTH 10 .
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE,POSITION 16.
PARAMETERS SRNO10 TYPE c LENGTH 2.
SELECTION-SCREEN: POSITION 23 .
PARAMETERS FORMNO10 TYPE c LENGTH 10 .

SELECTION-SCREEN: END OF LINE.

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

Output...

Regards

DJ

0 Kudos

HI Dibyajeevan,

Thank you so much, Its good. But when i input more that 1 form 38 no then only last form 38 no stored in table. So i want to know that we should change in program where we insert this value(in create statement) ? what type changes required ? please guide me.

0 Kudos

Hi,

Sorry , i didn't get your query, can you explain bit more , what is the actual requirement .

Regards

DJ

0 Kudos

Given is the print screen.

I have this screen. When i fill all field and fill more than 1 field in form 38 then only last form 38 value stored in table. Rest of the value stored proerly. Problem in storing only form 38 field.

I used this code for inserting data in table.

When 'SAVE'.

       Wa_itab-VENCode = VENCode-low.

*      wa_itab-lifnr = lifnr.

       Wa_itab-DATEISS = itab-dateiss.

       Wa_itab-PLANT = PLANT-low.

       Wa_itab-REMARKS = REMARKS-low.

       Wa_itab-FORM38 = form.

       Insert into ZFORM38NO values wa_itab.

0 Kudos

Hi,

--> R u using  all parameters  i.e  formno1 formno2.....formno15 for uploading into table ?

--> Also check  the internal table, you r using  to upload data into database table ( The key fields for all 15 records with 15 form no should not be same in database table .) .

If all  above points r ok ..

then share ur code  and  database table fields .

Regards

DJ

0 Kudos

Hi raj,

     There are nearly 15 fileds of form38, which filed you want to store into your Ztable???

Is there 15 fileds are in your Ztable for Form38 like form38no1,form39no2 like that...

if your Ztable have 15 fileds for form38 as you declared in your selection screen, use

  Wa_itab-VENCode = VENCode-low.

*      wa_itab-lifnr = lifnr.

       Wa_itab-DATEISS = itab-dateiss.

       Wa_itab-PLANT = PLANT-low.

       Wa_itab-REMARKS = REMARKS-low.

       Wa_itab-FORM38 = form.    ---------------------------> here use your selection screen parameter filed

       Insert into ZFORM38NO values wa_itab.

Any queries ??

Rgds,

Vijay SR

0 Kudos

When 'CREATE'.

      Wa_itab-VENCode = VENCode-low.

      Wa_itab-DATEISS = itab-dateiss.

      Wa_itab-PLANT = PLANT-low.

      Wa_itab-REMARKS = REMARKS-low.

      Wa_itab-FORM38 = form.

      Wa_itab-FORM38 = form1.

      Wa_itab-FORM38 = form2.

      ....

      ....

      Wa_itab-FORM38 = form15.

      Insert into ZFORM38NO values wa_itab.

      if sy-subrc = 0.

        MESSAGE 'Data Saved Successfully' TYPE 'I'.

      ENDIF.

0 Kudos

I already tried it but its store only last value of form 38 field.

When 'CREATE'.

      Wa_itab-VENCode = VENCode-low.

      Wa_itab-DATEISS = itab-dateiss.

      Wa_itab-PLANT = PLANT-low.

      Wa_itab-REMARKS = REMARKS-low.

      Wa_itab-FORM38 = form.

      Wa_itab-FORM38 = form1.

      Wa_itab-FORM38 = form2.

      ....

      ....

      Wa_itab-FORM38 = form15.

      Insert into ZFORM38NO values wa_itab.

      if sy-subrc = 0.

        MESSAGE 'Data Saved Successfully' TYPE 'I'.

      ENDIF.

0 Kudos

Hi,


When 'SAVE'.

       Wa_itab-VENCode = VENCode-low.          ''same for all forms

       Wa_itab-DATEISS = itab-dateiss.               ''same for all forms

       Wa_itab-PLANT = PLANT-low.                    ''same for all forms

       Wa_itab-REMARKS = REMARKS-low.      ''same for all forms

    

       Wa_itab-FORM38 = form38_1.

       Insert into ZFORM38NO values wa_itab.

       Wa_itab-FORM38 = form38_2.

        Insert into ZFORM38NO values wa_itab.

      Wa_itab-FORM38 = form38_3.

      Insert into ZFORM38NO values wa_itab.

...

...

      Wa_itab-FORM38 = form38_15.

      Insert into ZFORM38NO values wa_itab.

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

....Look  , in above..  for all records , i guess  key fields are same  in database table . Add  another key fields in database table for identifying  form38  number .

A database table can not contain more than one record with same key field values . key field values should different for all records .



IF ANY QUERY,  SEND THE KEY FIELDS OF THE DATA BASE TABLE .

Regards

DJ

0 Kudos

Hi Raj,

It will store the last value only if your Ztable which has one filed to store the value of form38..

understood??

Your Ztable which have only one filed to store Form38value ...Correct ??

Which value you want to store in to your Ztable for form38 , whether form 1 or form 2 or form3 ....etc

Wa_itab-FORM38 = form.

      Wa_itab-FORM38 = form1.

      Wa_itab-FORM38 = form2.

      ....

      ....

      Wa_itab-FORM38 = form15.

here what will happen means , the last value   Wa_itab-FORM38 = form15. will be stored in your table..

otherwise create your ztable with some more fileds for form38 like form38_1 , form38_2 ,....form38_15

and continue with the code...

Wa_itab-VENCode = VENCode-low.

      Wa_itab-DATEISS = itab-dateiss.

      Wa_itab-PLANT = PLANT-low.

      Wa_itab-REMARKS = REMARKS-low.

      Wa_itab-FORM38_1 = form.   " These are new fileds added to your Ztable..

      Wa_itab-FORM38 _2 = form1.

      Wa_itab-FORM38_3  = form2.

      ....

      ....

      Wa_itab-FORM38_15  = form15.

Hope you understood...

Thanks,

Vijay SR

0 Kudos

For every form38 , u have to insert once  (15 times) . as  below

0 Kudos

HI Dibyajeeban Jena,


I have 1 more problem. I have a change screen. when i give vendor name and then click on display then it show all value for that vendor. Now user want to edit form 38 no (more than one field at a time) change and click on change button. But problem is that form 38 field is not editable..so please guide me what should i do for that. Should we need to design a new screen for that or we continue with the same screen as given below.


0 Kudos

Hi Raj,

I want know how u r displaying data on the screen . If you are using ALV for the same then we have option like ..

  WA_FieldCatalog-INPUT = 'X' .
   wa_fieldcatalog-edit = 'X' .


or u can use a table control  on screen for the same .


Please share ur code for  more clarification .


Regards

DJ

0 Kudos

Sir,

As i already told you that i am making a zscreen for form-38. In my first screen there is 3 option.CREATE, CHANGE,DISPLAY. CREATE and DISPLAY is ok. IN change screen as i already posted with print screen. When i give vendor code it show all value for that vendor( which is created in ztable.). So if user want to change any thing then they can change. currently in my screen value display but not editable. Given is the code for change screen.

SELECTION-SCREEN : BEGIN OF SCREEN 202, " Change screen.

                   begin of block b4 with frame title text-003.

SELECT-options : form38 for ZFORM38NO-FORM38 matchcode object ZFORM38_FORM,

                 VENCode1 for ZFORM38NO-VENCODE matchcode object zform38 obligatory, " OBLIGATORY,

                 DATEISS1 for ZFORM38NO-DATEISS no intervals no-extension matchcode object ZFORM38_DATE,

                 PLANT1 for ZFORM38NO-PLANT.

Selection-screen : skip 2,

PUSHBUTTON 5(10) a2 user-command CHANGE,

pushbutton 17(10) a11 user-command DISP1.

SELECTION-SCREEN : end of block b4,

                   end of screen 202.

Initialization.

  A2 = 'Change'.

  A11 = 'Display'.

When 'CHA'.

      call selection-screen 202.

      WHEN 'DISP1'.

     PERFORM get_data1.

      When 'CHANGE'.

      Wa_itab-FORM38 = FORM38.

      Wa_itab-VENCode = VENCode1.

      Wa_itab-DATEISS = DATEISS1.

      Wa_itab-PLANT = PLANT1.

      Update ZFORM38NO from wa_itab.

      if sy-subrc = 0.

        MESSAGE 'Data Changed Successfully' TYPE 'I'.

      endif.

FORM GET_DATA1 .

  CLEAR: GS_SELFIELD, GT_OUTTAB[], GT_FIELDCAT[].

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

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'

       EXPORTING

            I_STRUCTURE_NAME       = 'ZFORM38NO'

       changing

            ct_fieldcat            =  gt_fieldcat[].

read table gt_fieldcat with key fieldname = 'REMARKS'.

  if sy-subrc = 0.

    gt_fieldcat-no_out = 'X'.

    modify gt_fieldcat index sy-tabix.

  endif.

  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

       EXPORTING

            I_TITLE                 = vencode1-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.

endform.

If it is ok through pop up window then tell me how to do it in editable mode. Otherwise plz guide me for table control.

0 Kudos

Hi,

check the changes below........

SELECTION-SCREEN : BEGIN OF SCREEN 202, " Change screen.

                   begin of block b4 with frame title text-003.

SELECT-options : form38 for ZFORM38NO-FORM38 matchcode object ZFORM38_FORM,

                 VENCode1 for ZFORM38NO-VENCODE matchcode object zform38 obligatory, " OBLIGATORY,

                 DATEISS1 for ZFORM38NO-DATEISS no intervals no-extension matchcode object ZFORM38_DATE,

                 PLANT1 for ZFORM38NO-PLANT.

Selection-screen : skip 2,

PUSHBUTTON 5(10) a2 user-command CHANGE,

pushbutton 17(10) a11 user-command DISP1.

SELECTION-SCREEN : end of block b4,

                   end of screen 202.

Initialization.

  A2 = 'Change'.

  A11 = 'Display'.

When 'CHA'.

      call selection-screen 202.

      WHEN 'DISP1'.

     PERFORM get_data1.

      When 'CHANGE'.

      Wa_itab-FORM38 = FORM38.

      Wa_itab-VENCode = VENCode1.

      Wa_itab-DATEISS = DATEISS1.

      Wa_itab-PLANT = PLANT1.

      Update ZFORM38NO from wa_itab.

      if sy-subrc = 0.

        MESSAGE 'Data Changed Successfully' TYPE 'I'.

      endif.

FORM GET_DATA1 .

  CLEAR: GS_SELFIELD, GT_OUTTAB[], GT_FIELDCAT[].

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

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'

       EXPORTING

            I_STRUCTURE_NAME       = 'ZFORM38NO'

       changing

            ct_fieldcat            =  gt_fieldcat[].

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

data : fcat like line of gt_fieldcat .

loop at  gt_fieldcat[] in wa_fcat .

if wa_fcat-fieldnam  = 'FORM38'  .  "name of the field containing form38  in ZFORM38NO  table

  WA_FCat-INPUT = 'X' .
   wa_fcat-edit = 'X' .

modify  gt_fieldcat[] from wa_fcat transporting input  edit .

endif .

endloop.

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

read table gt_fieldcat with key fieldname = 'REMARKS'.

  if sy-subrc = 0.

    gt_fieldcat-no_out = 'X'.

    modify gt_fieldcat index sy-tabix.

  endif.

  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

       EXPORTING

            I_TITLE                 = vencode1-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.

endform.

Try above code,,

Regards

DJ

0 Kudos

Sir,

data : fcat like line of gt_fieldcat .

loop at  gt_fieldcat[] in wa_fcat .

if wa_fcat-fieldnam  = 'FORM38'  .  "name of the field containing form38  in ZFORM38NO  table

  WA_FCat-INPUT = 'X' .
   wa_fcat-edit = 'X' .

modify  gt_fieldcat[] from wa_fcat transporting input  edit .

endif .

endloop.

I tried it but get some error.

I changed in with into

data : fcat like line of gt_fieldcat .

loop at  gt_fieldcat[] into wa_fcat .

if wa_fcat-fieldnam  = 'FORM38'  .  "name of the field containing form38  in ZFORM38NO  table

  WA_FCat-INPUT = 'X' .
   wa_fcat-edit = 'X' .

modify  gt_fieldcat[] from wa_fcat transporting input  edit .

endif .

endloop.

again get error........

0 Kudos

Sir,

Now problem solved. Thank you so much.