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

Module Pool

harshsisodia31
Participant
0 Likes
2,824

  Dear Experts,

      My requirement is that i want to add and an additional i/p field in SAPMJ1IG screen 0400.

      I have added field (ADD_RG_NO) but when i m trying to use this in my code. It is not showing values entered.

      Kindly guide.

      Please refer screnn shot for refernce.

    

     Thanks.

     Harsh

1 ACCEPTED SOLUTION
Read only

paul_max1
Explorer
0 Likes
1,324

Hello Harsh,

As this screen is a standard one and by default you do not have the ADD_RG_NO field, try to read the values from there with function module DYNP_VALUES_READ importing field names.

The function has documentation about using it.

Have a nice day,

Paul.

10 REPLIES 10
Read only

paul_max1
Explorer
0 Likes
1,325

Hello Harsh,

As this screen is a standard one and by default you do not have the ADD_RG_NO field, try to read the values from there with function module DYNP_VALUES_READ importing field names.

The function has documentation about using it.

Have a nice day,

Paul.

Read only

0 Likes
1,324

Hi paul

I Tried using this function module getting error  INVALID_DYNPRONAME.

Can u please share the Import parameters to be passed, mine is as below

data: dyname like d020s-prog value 'SAPMJ1IG',
         dynumb like d020s-dnum value '0400'.
   data: begin of dynpfields occurs 3.
           include structure dynpread.
   data: end of dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'
     EXPORTING
       DYNAME                               = dyname
       DYNUMB                               = dynumb
*     TRANSLATE_TO_UPPER                   = ' '
*     REQUEST                              = ' '
*     PERFORM_CONVERSION_EXITS             = ' '
*     PERFORM_INPUT_CONVERSION             = ' '
*     DETERMINE_LOOP_INDEX                 = ' '
*     START_SEARCH_IN_CURRENT_SCREEN       = ' '
*     START_SEARCH_IN_MAIN_SCREEN          = ' '
*     START_SEARCH_IN_STACKED_SCREEN       = ' '
*     START_SEARCH_ON_SCR_STACKPOS         = ' '
*     SEARCH_OWN_SUBSCREENS_FIRST          = ' '
*     SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
     TABLES
       DYNPFIELDS                           = dynpfields

*   EXCEPTIONS
*     INVALID_ABAPWORKAREA                 = 1
*     INVALID_DYNPROFIELD                  = 2
*     INVALID_DYNPRONAME                   = 3
*     INVALID_DYNPRONUMMER                 = 4
*     INVALID_REQUEST                      = 5
*     NO_FIELDDESCRIPTION                  = 6
*     INVALID_PARAMETER                    = 7
*     UNDEFIND_ERROR                       = 8
*     DOUBLE_CONVERSION                    = 9
*     STEPL_NOT_FOUND                      = 10
*     OTHERS                               = 11
             .
   IF SY-SUBRC <> 0.
* Implement suitable error handling here
   ENDIF.

Read only

0 Likes
1,324

Harsh,

Set a break-point in the screen and check the SY-CPROG variable please.

Read only

0 Likes
1,324

Still not working. The value I passed and SY-CPROG have same value.

Read only

0 Likes
1,324

You call the function in the PAI module, right ?

Weird because I was debugging some days ago a situation exactly like yours, and worked well...

Read only

0 Likes
1,324

Hi Paul

Solved the error.

But still it is not returning any values.

I have written the code in

PROCESS AFTER INPUT.
   MODULE USER_COMMAND_0300 AT EXIT-COMMAND.

In USER_COMMAND_0300 there is
PERFORM user_command.

In user_command


DATA LIN TYPE I.
   PERFORM check_confirm_data_loss.

     *************My CODE*******************

Thanks

Harsh

Read only

0 Likes
1,324

Did you insert name of field in dynpfields-fieldname ?

Read only

0 Likes
1,324

Try the code below:

data:    dyname TYPE d020s-prog value 'SAPMJ1IG',
         dynumb TYPE d020s-dnum value '0400'.
data:      gt_dynpfields type table of dynpread,
         gs_dynpfields type          dynpread.

clear gs_dynpfields.
gs_dynpfields-fieldname = 'ADD_RG_NO'.
APPEND gs_dynpfields TO gt_dynpfields.
                 
CALL FUNCTION 'DYNP_VALUES_READ'
     EXPORTING
       DYNAME                               = dyname
       DYNUMB                               = dynumb
     TABLES
       DYNPFIELDS                           = gt_dynpfields
   EXCEPTIONS
     INVALID_ABAPWORKAREA                 = 1
     INVALID_DYNPROFIELD                  = 2
     INVALID_DYNPRONAME                   = 3
     INVALID_DYNPRONUMMER                 = 4
     INVALID_REQUEST                      = 5
     NO_FIELDDESCRIPTION                  = 6
     INVALID_PARAMETER                    = 7
     UNDEFIND_ERROR                       = 8
     DOUBLE_CONVERSION                    = 9
     STEPL_NOT_FOUND                      = 10
     OTHERS                               = 11.

Read only

0 Likes
1,324

Hi Paul.

This code worked for me. Thanks alot.

Below part of code did the trick

clear gs_dynpfields.

gs_dynpfields-fieldname = 'ADD_RG_NO'.

APPEND gs_dynpfields TO gt_dynpfields.

Read only

former_member188282
Active Participant
0 Likes
1,324

Hi,

Check the table control structure. is this field (ADD_RG_NO) did u added in that structure.

In PBO maintain this field in

LOOP AT... ENDLOOP

Thanks,

Rajesh.