03-20-2014 9:25 AM
Hi,
I used following code to populate the GL account description from SKAT table.
CLASS LCL_EVENT_RECEIVER1 DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLE_DATA_CHANGED
FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED.
ENDCLASS. "lcl_event_receiver1 DEFINITION
DATA: G_EVENT_RECEIVER1 TYPE REF TO LCL_EVENT_RECEIVER1.
*----------------------------------------------------------------------*
* CLASS LCL_EVENT_RECEIVER1 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS LCL_EVENT_RECEIVER1 IMPLEMENTATION.
* Logic to access data and change itab and refresh table display
METHOD HANDLE_DATA_CHANGED.
DATA: LS_GOOD TYPE LVC_S_MODI,
LS_account like i_apr_tab,
* ls_disc type TEXT50, changed by Kiran
l_ktopl like t001-ktopl,
LS_GOOD_COST TYPE LVC_S_MODI.
LOOP AT ER_DATA_CHANGED->MT_GOOD_CELLS INTO LS_GOOD.
CASE LS_GOOD-FIELDNAME.
WHEN 'GLACC'.
SELECT SINGLE ktopl FROM T001
INTO l_ktopl
where bukrs = g_head-bukrs.
select single txt50 from skat
INTO i_glcod-txt50 where SAKNR = ls_good-value
and SPRAS = sy-langu and ktopl = l_ktopl.
CALL METHOD ER_DATA_CHANGED->MODIFY_CELL
EXPORTING
I_ROW_ID = ls_good-ROW_ID
I_FIELDNAME = 'TXT50'
I_VALUE = i_glcod-TXT50 ."ls_disc. kiran
ENDCASE.
ENDLOOP.
ENDMETHOD. "handle_data_changed
ENDCLASS. "lcl_event_receiver1 DEFINITION
I used this for one screen, the values are going to the Internal table and i saved it. . When I call the screen of other screen to see the description of this( the GL account description ) is showing blank... So probably something wrong in my Select statement.
So what would be the best Select Statement to fetch the record from the Internal table and to display it in another screen( when I call detail screen)??
kindly help me out with this..
Thanks in advance.
Regards,
Kiran
03-20-2014 9:30 AM
Please note that the domain behind SAKNR has a conversion exit, the values are stored internally in length 10 with leading zeros.
Make sure the value in LS_GOOD-VALUE is formatted accordingly when it hits the select statement.
Thomas
03-20-2014 9:30 AM
Please note that the domain behind SAKNR has a conversion exit, the values are stored internally in length 10 with leading zeros.
Make sure the value in LS_GOOD-VALUE is formatted accordingly when it hits the select statement.
Thomas
03-20-2014 9:37 AM
Hi Thomas,
Thanks for your reply. Everything works perfectly in detail screen, when I add GL account number, Its description is populating automatically, it is saving as well in MODE= I.
But when I again give the record number and the MODE as P, only GL number is showing, not its Description..
I need its description to show as how the GL number is showing...
what to do for that?
Regards,
Kiran
03-20-2014 10:01 AM
Hi Kiran,
When you call your screen at the first time, the description is shown in your ALV, isn't it?, but I think that you aren't updating your internal table(which is shown in the ALV) with that value. To achieve this, you should also use the method CHECK_CHANGED_DATA, which updates the internal table with the ALV values.
Best Regards
03-20-2014 10:11 AM
Hi Adrian,
As you said, when i call the screen at the first time the description is shown..
As you mentioned, I need to use the Method CHECK_CHANGED_DATA.. So whats the procedure of using this and Where???
please do reply for this.
Regards,
Kiran
03-20-2014 10:42 AM
You could call this method on each USER_COMMAND action for example.
Best regards
03-20-2014 10:27 AM
You declare the internal table globally.
Your select query is right.
On 1st screen, export the internal table to memory ID.
EXPORT int_tab TO MEMORY ID 'ABC'.
On other screen, import the table from memory ID
IMPORT int_tab FROM MEMORY ID 'ABC'.
With this you can have all the data in int table from screen1 to other screen.
03-21-2014 7:25 AM