11-07-2016 1:19 PM
Hi Experts,
I am currently trying to build a table control for table T77UA.
I am facing some issues while implementing the New Entries functionality. I initially get a screen with all the values from the table, then when clicking on new entries I cleared the values from the internal table so I could get the new entries and then save them into the database table.
The thing is that I don't seem to have the new values nowhere, not the control or the internal table.t77ua.jpg
Can you tell me how do I retain the new values?
If you have an example or demo program for this would be much appreciated.
Thank you.
Best regards,
Elena
11-11-2016 3:54 PM
Hi I've checked your code
PBO:
LOOP AT SDYN_ITAB INTO ZT77UA WITH CONTROL TABLE_CONTROL.
ENDLOOP.
PAI
LOOP AT SDYN_ITAB.
MODULE READ_TABLE_CONTROL.
ENDLOOP.
And module READ_TABLE_CONTROL
MODULE READ_TABLE_CONTROL INPUT. IF MARK = 'X' AND SAVE_OK = 'DELE'.
READ TABLE TABLE_CONTROL-COLS INTO COL WITH KEY SCREEN-INPUT = '1'.
IF SY-SUBRC = 0.
DELETE TABLE SDYN_ITAB FROM ZT77UA.
DESCRIBE TABLE SDYN_ITAB KINES TABLE_CONTROL-LINES.
ENDIF.
ELSE.
DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
MODIFY SDYN_ITAB FROM ZT77UA INDEX TABLE_CONTROL-CURRENT_LINE.
ENDIF.
ENDMODULE.
This code is ok if you need to change existing record, but if you insert a new record in table control, this won't automatically be in your internal table:
you need to append it
For example your module READ_TABLE_CONTROL can check if the record is or isn't in SDYN_ITAB
MODULE READ_TABLE_CONTROL INPUT.
IF MARK = 'X' AND SAVE_OK = 'DELE'.
READ TABLE TABLE_CONTROL-COLS INTO COL WITH KEY SCREEN-INPUT = '1'.
IF SY-SUBRC = 0.
DELETE TABLE SDYN_ITAB FROM ZT77UA.
DESCRIBE TABLE SDYN_ITAB KINES TABLE_CONTROL-LINES.
ENDIF.
ELSE.
DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
MODIFY SDYN_ITAB FROM ZT77UA INDEX TABLE_CONTROL-CURRENT_LINE.
IF SY-SUBRC <> 0.
APPEND ZT77UA TO SDYN_ITAB.
ENDIF.
ENDIF.
ENDMODULE.
Or something else like above
11-07-2016 6:34 PM
There are tons of examples that can be found in Google. But what on earth are you doing creating a table control with new entries for the standard authorization table?
11-08-2016 7:11 AM
Hello,
I've looked it up before posting the message and I couldn't locate the same example as in my scenario.
About the authorization table this is a customizing table where you can add entries only by using a transport request.
They want to be able to maintain it directly without changing the type of the standard table.
Getting back to my question, where is that the new values are being saved? Cause I cannot locate them anywhere in the backend structures.
Best,
Elena
11-08-2016 8:05 AM
11-08-2016 9:11 AM
Hi,
I've looked up to programs like:
And I couldn't locate the answer. After the tab get's cleared and I get the empty screen, the new introduced values are nowhere as it goes directly to PAI in the user_command module.
Best,
Elena
11-08-2016 9:56 AM
In the flow logic, both in PBO and PAI, you have a LOOP WITH CONTROL, which loops at every line on the screen, you must execute a module to transfer all fields in the current line of the internal table.
11-08-2016 9:11 AM
Hi,
may be those requesting that change should read this OSS Note (search for T77UA):
2054808 - HR authorizations: Collective SAP Note with questions and answers
Best regards,
Pablo
11-08-2016 9:29 AM
Hi Pablo,
Appreciate the answer, I will pass it on.
They are using structural authorizations in CRM, and is only being used as fixed structural authorizations for Personnel administrators so they can get access to a certain part of the organization.
There are a few authorization profiles assigned to limited resources.
Table T77UA is already maintainable in production as the System attributes are setup to Live.
They need to be able to assign new administrators to their org unit also in dev or quality in the same way.
Best,
Elena
11-08-2016 9:58 AM
Hi
You should post your PBO/PAI code, you can considerate the data are in two different layer:
- Screen
- Memory
In PBO the data have to be transfered from Memory (so your internal table) to Screen (so your table control)
In PAI the data have to be transfered from screen (so your table control) to memory (so your internal table)
Max
11-11-2016 3:00 PM
Hi Max,
Thank you for the explanation. I am currently thinking that I am missing something in the PAI part because the data is not passed correctly from the screen to the internal table.
Once I clear the internal table and want to retain the new values it doesn't work.
My apologies if this is silly, but I haven't work with GUI screens that much.
I have attached my code, maybe you can notice what I am doing wrong.
Thanks in advance.
Best regards,
Elena
table-control.jpg11-11-2016 3:54 PM
Hi I've checked your code
PBO:
LOOP AT SDYN_ITAB INTO ZT77UA WITH CONTROL TABLE_CONTROL.
ENDLOOP.
PAI
LOOP AT SDYN_ITAB.
MODULE READ_TABLE_CONTROL.
ENDLOOP.
And module READ_TABLE_CONTROL
MODULE READ_TABLE_CONTROL INPUT. IF MARK = 'X' AND SAVE_OK = 'DELE'.
READ TABLE TABLE_CONTROL-COLS INTO COL WITH KEY SCREEN-INPUT = '1'.
IF SY-SUBRC = 0.
DELETE TABLE SDYN_ITAB FROM ZT77UA.
DESCRIBE TABLE SDYN_ITAB KINES TABLE_CONTROL-LINES.
ENDIF.
ELSE.
DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
MODIFY SDYN_ITAB FROM ZT77UA INDEX TABLE_CONTROL-CURRENT_LINE.
ENDIF.
ENDMODULE.
This code is ok if you need to change existing record, but if you insert a new record in table control, this won't automatically be in your internal table:
you need to append it
For example your module READ_TABLE_CONTROL can check if the record is or isn't in SDYN_ITAB
MODULE READ_TABLE_CONTROL INPUT.
IF MARK = 'X' AND SAVE_OK = 'DELE'.
READ TABLE TABLE_CONTROL-COLS INTO COL WITH KEY SCREEN-INPUT = '1'.
IF SY-SUBRC = 0.
DELETE TABLE SDYN_ITAB FROM ZT77UA.
DESCRIBE TABLE SDYN_ITAB KINES TABLE_CONTROL-LINES.
ENDIF.
ELSE.
DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
MODIFY SDYN_ITAB FROM ZT77UA INDEX TABLE_CONTROL-CURRENT_LINE.
IF SY-SUBRC <> 0.
APPEND ZT77UA TO SDYN_ITAB.
ENDIF.
ENDIF.
ENDMODULE.
Or something else like above