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: 

ML81N implementing screen exit facing error in EXIT_SAPLMLSR_020 field can not be changed

pashasapcha
Participant
0 Kudos
708

microsoftteams-image.pngHi gurus,

I am working on scree exit for ML81N, I am working on implementing SRVEUSCR :User screen on entry sheet tabstrip.

I could able to manage to get the custom field on the addional tab next to history tab, using subscreen SAPLXMLU 0399.

When I execute ML81N, I can able to see the additional date filed on the new tab which I have added.

Now I am implementing the function exit associated with SRVEUSCR

EXIT_SAPLMLSR_020 :Transfer of Data to Entry Sheet User Screen

When I am using this import exit , it is giving me the error "The field I_ESSR-ZINVRECDAT can not be changed". ZINVRECDAT is the field I have added using CI_ESSRDB to ESSR table. I just want to get sy-datum as default value upon execution of ML81N on additional screen and the same date to be captured in database table ESSR.

Kindly please help me with it at the earliest as I am struggling with it from 2 days.

I also want to know is it mandatory to implement both the function exits, EXIT_SAPLMLSR_020 and EXIT_SAPLMLSR_021 ?

10 REPLIES 10

raymond_giuseppi
Active Contributor
595

You cannot change the imported parameters. (Read-Only, This exit receive this data and you have to save it in the exit function group to map it to dynpro)

  • So define some ESSR (and a AKTYP field too) memory area in TOP include ZXMLUTOP (only case where to use TABLES statement nowadays allowed)
  • Move I_ESSR data to this area, you can then change subfields in your area not in the imported parameter

0 Kudos
595

I really appreciate your quick response and support. I am very new to this field, working on enhancements for first time. Can you please elaborate me and help me in getting the screen field date value stored in db table ESSR. I can not able to find where the ZXMLUTOP exist. I have no idea how to work on " you have to save it in the exit function group to map it to dynpro)"

Kindly please help me and get me out of this issue.

0 Kudos
595
  1. Display the exit FM EXIT_SAPLMLSR_020, in the menu navigate : goto, global data, double-click on the Z-include, confirm creation. (Here you define some fields to be shared with the dynpro and between the different call of exit FM.)
  2. Create a shared aread with (example) TABLES: ESSR, ESSRDB_CI.
  3. Go back to exit
  4. Add a MOVE I_ESSR to ESSR, MOVE-CORRESPONDING to ESSRDB_CI (depends if you use ESSR or CI_ESSR in your dynpro) there you can force some data at PBO (but do it only once if user is allowed to change data, either use a flag '(already done' or only fill when initial)
  5. In the FM EXIT_SAPLMLSR_021 fill E_ESSRDB from those area (send data back to main program)

0 Kudos
595

Issue finally resolved. Now I can able to capture data with this piece of code in pbo.

declaring tables in top include actually helped me to get out of errors. Thanks for your support .

in pbo the code is

CI_ESSRDB-ZINVDAT = SY-DATUM.

ESSR-ZINVDAT = CI_ESSRDB-ZINVDAT.

in Pai the code is

E_ESSRDB-ZINVDAT = ESSR-ZINVDAT.

Thanks Raymond . Will come back to you with new issue.:)

pashasapcha
Participant
0 Kudos
595

I have added tables to top , but it looks like the exit/include is not getting refreshed. because even after deleting few lines, it is throwing the same error which was there due to the lines which were there before deletion.

I have removed ESSR but it is sill pointing out to the same error which was before .. I have saved, check and trying to activate.

raymond_giuseppi
Active Contributor
0 Kudos
595
  • If ESSR already declared, this is OK
  • But, this is not the top include (LXMLUTOP which contains include ZXMLUTOP for abap developper)

Only define those area/variable once

pashasapcha
Participant
0 Kudos
595

INCLUDE ZXMLUTOP. I have added here.

pashasapcha
Participant
0 Kudos
595


pai PART IS WORKING FINE.
The requirement is user will not enter any value in the newly added customfield, the moment when the user goes to the additional custom tab, he should see the sy-datum value there. As PAI is wokring fine, the date will automatically get saved in db table ESSR.Right now what I am doing is manually entering date field(01.02.2023) value on the screen while running ML8I1N t code to get data stored in ESSR. So, PAI part is working fine.The new field is added in ESSR table at CI_ESSRDB as shown below.

I am now confused to use CL_ESSSRDB , I_ESSR or both to make ZINVDAT in ML81N get sy-datum value.

Please help me what code should be used in PBO to get default sy-datum value on screen

HOW to import sy-datum value on screen date field ?

Sandra_Rossi
Active Contributor
0 Kudos
595

Answer without any explanation. The one by Raymond is quite good and will help more future visitors.

moshenaveh
Community Manager
Community Manager
0 Kudos
595

pashasapcha

I'm glad you received an answer to your question. Please be sure to mark the one suitable as correct. Please don't add additional information as new answers but as comments.