11-27-2013 3:22 PM
Hi,
I added a new field in my custom data screen at purchase order, when i save data, it's saved perfect in EKPO, but mode status stay always in change mode. I want to make it as display mode WHEN I SAVE my purchase order:
Any suggestions ?
Thank u.
11-27-2013 3:27 PM
Hi,
Check BADI " ME_PROCESS_PO_CUST" and the method "CHECK".
Try to implement this BADI, hopefully it would help.
Regards,
Sumit
11-27-2013 3:30 PM
11-27-2013 4:43 PM
Since you have to change the attribute, you need to use methods based on requirement.
First identify , is your custom field at header level or item level??
If it is at header level, then use method "FIELDSELECTION_HEADER_REFKEYS" and if it is item level then use method FIELDSELECTION_ITEM_REFKEYS.
These methods will pass either header object or item object, from which you can read your field and change the attribute.
Thanks,
Sumit
11-28-2013 9:44 AM
Hi,
this is for the Item level.
i tried a several codes but it doesn't work yet.
Do you have example code.
My added field is ZZTRANSPORT.
11-28-2013 10:25 AM
I tried this code :
TYPE-POOLS: mmmfd.
DATA : po_item TYPE mepoitem.
FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
po_item = im_item->get_data( ).
IF po_item IS NOT INITIAL.
IF po_item-zztransport IS NOT INITIAL.
READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY metafield = mmmfd_out_netpr.
IF sy-subrc IS INITIAL.
<fs>-fieldstatus = '*'. " Display
ENDIF.
ENDIF.
But i receive that error:
Field "CH_FIELDSELECTION" is unknown. It is neither in one of the |
specified tables nor defined by a "DATA" statement . . . . . . . . . . |
** When i do break-point in this method, and i test in me22n, the program did not call the method FIELDSELECTION_ITEM_REFKEYS !!!!!!!
Any suggestion ?
11-28-2013 1:07 PM
I tried also this abap code :
MODULE user_command_0111 INPUT.
if sy-ucomm = 'MESAVE' and sy-tcode = 'ME22N'.
loop at screen.
"if screen-name CS 'EKPO_CI-ZZTRANSPORT'.
screen-input = 0.
modify screen.
"endif.
endloop.
endif.
ENDMODULE.
But it doesn't work..... !!
11-28-2013 1:57 PM
Hi,
After PBO of your screen
process before output.
module event_pbo.
module event_pbo output.
if sy-ucomm = 'MESAVE' and sy-tcode = 'ME23N'.
loop at screen.
if screen-name eq 'EKPO_CI-ZZTRANSPORT'.
SCREEN-ACTIVE = 0. " diable
endif.
modify screen.
exit.
endif.
endloop.
endif.
Thanks,
Kiran.
endmodule.
11-28-2013 2:20 PM
this if sy-ucomm = 'MESAVE' and sy-tcode = 'ME23N'.
well be never works in PBO, because in PBO i can't get the value of sy-ucomm, it's always empty. !!!
11-28-2013 1:28 PM
Hi,
Never code for field-attrbutes in PAI. Instead use your code in PBO.
In PAI, just have a flag variable to be populated.
IF FLAG = 'X'.
Your Code for disabling the input.
endif.
11-28-2013 2:23 PM
What is Flag ? it's unknown .
i did like that:
MODULE event_pbo OUTPUT.
BREAK-POINT.
IF flag = 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'EKPO_CI-ZZTRANSPORT'.
screen-active = 0. " diable
ENDIF.
MODIFY SCREEN.
EXIT.
ENDLOOP.
ENDIF.
ENDMODULE.
it 's not working yet
11-28-2013 2:31 PM
My dear FLAG should be declared first as global variable and to be set to' X' in PAI module.
Leave that FLAG, just without FLAG try to use your code in PBO.
LOOP AT SCREEN.
IF screen-name EQ 'EKPO_CI-ZZTRANSPORT'.
screen-input = 0.
screen-active = 0. " diable
ENDIF.
MODIFY SCREEN.
EXIT.
ENDLOOP.
After that you will be ale to understand what conditions have to be in place.
11-28-2013 2:46 PM
ok.
I write this code now:
data aktyp type c.
IF aktyp = 'V'.
LOOP AT SCREEN.
IF screen-name EQ 'EKPO_CI-ZZTRANSPORT'.
screen-input = 0. " diable
ENDIF.
MODIFY SCREEN.
EXIT.
ENDLOOP.
ENDIF.
but when i debug, i find aktyp always = V, and deed not make any change yet !!!!!!
in my PBO i use already:
module status_0111 output.
IF sy-tcode EQ 'ME23' OR sy-tcode EQ 'ME23N'.
LOOP AT SCREEN.
IF screen-group1 EQ 'A1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
endmodule.
And *************************************************
module field_mode output.
loop at screen.
if screen-name cs 'EKPO_CI-ZZTRANSPORT'.
if ( sy-tcode = 'ME21' or sy-tcode = 'ME22' or
sy-tcode = 'ME21N' or sy-tcode = 'ME22N').
" screen-input = 1.
ELSEIF sy-tcode = 'ME23' or sy-tcode = 'ME23N'.
screen-input = 0.
endif.
modify screen.
endif.
endloop.
endmodule. " field_mode OUTPUT
11-28-2013 4:05 PM