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: 

in ML81N date field in display mode is showing current date rather than picking from ESSR table date

pashasapcha
Participant
0 Kudos

I recently done screen enhancement in ML81N . I added new field with sy-datum as default value and the date is getting stored in ESSR

data base table.

Now, when I am trying to see details of earlier service entry sheets in display mode, the new field is showing current date (SY-DATUM ) only. rather than picking the value from the ESSR table.

So first I have to find out how the system identifies if it is change mode or display mode.

I have checked SY structure and can see UCOMM , XPROG and CPROG is same for both in display and change mode.

I was expecting sy-ucomm to be different for both change and display mode so that I can get current date in change mode and Fetch date value from

ESSR table in display mode.

But here i can see SY-UCOMM = HC12 for both change and display mode.

The code is working perfect in change mode.

The issue is with display mode also , getting today's date in newly added date.

Kindly please help me to fix this issue.

1 ACCEPTED SOLUTION

thkolz
Contributor
0 Kudos

I think you need to implement those two user exits in the opposite way.

ZXMLUU27 is to transfer data from table ESSR to the screen. The code should be:

 MOVE-CORRESPONDING i_essr TO essr.

In ZXMLUU28 you must fill code as following in order to store the current date in ESSR:

e_essrdb-zinvdat = sy-datum.
4 REPLIES 4

thkolz
Contributor
0 Kudos

It seems the user exits are only processed in change mode...
Did you check in the debugger?

thkolz
Contributor
0 Kudos

I think you need to implement those two user exits in the opposite way.

ZXMLUU27 is to transfer data from table ESSR to the screen. The code should be:

 MOVE-CORRESPONDING i_essr TO essr.

In ZXMLUU28 you must fill code as following in order to store the current date in ESSR:

e_essrdb-zinvdat = sy-datum.

Brilliant Kolz
It worked for me. Now I am getting the value in the field value from table in display mode and sy-datum default on to screen in change mode.
Thanks alot 🙂

Hope you will comeup with solution to my other issue BADI implementation method PAYMENT_TERMS_SET.

0 Kudos

After UAT testing, the decision was taken that the new custom date field has to be kept blank but should be made mandatory.

I have opened the layout and made it mandatory as shown below

Then I have removed the sy-datum and replaced with ci_essrdb-ZINVDAT in its place as shown below.

No changes done in importing function exit as shown below.


MOVE-CORRESPONDING I_ESSR TO ESSR.

Then save and activate the project.

When I run the ML81N I am facing 2 issues here.

1. as I have made the new custom field mandatory, it is asking to enter the value and when I inserted value in it, it is getting disappeared when I do navigate across the other standard tabs.

Before I save it. I have to fill the field multiple times.

2.The value is not getting saved in the ESSR table.