‎2009 May 15 3:49 AM
Hi folks,
My requirement is to create a custom transaction with save , change and delete buttons. I have created the screen but I am stuck in the flow logic. the following is my flow logic.
data : wa_data type zlandr.
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
case sy-ucomm.
when 'DABA'.
mara-matnr = mara-matnr.
endcase.
ENDMODULE. " USER_COMMAND_1000 INPUT
&----
*& Module STATUS_1000 OUTPUT
&----
text
----
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'STATUS'.
ENDMODULE. " STATUS_1000 OUTPUT
but I am unable to generate screen its saying invalid field format.
Could somebody send me a sample code as I am new to this area.
Thanks
Rock
‎2009 May 15 3:52 AM
Hi,
Check the Screen fields and Field attributes on the screen.you might be missing some thing.
‎2009 May 15 4:06 AM
Hi,
Check whether you have given correct screen field and table field. Also check whether you have assigned ok_code.
if still you could not find the mistake, send in your full coding.
Regards,
Sakthi.
‎2009 May 15 4:45 PM
Hi folks,
This is my coding.
&----
*& Report ZRE_MAINTENANCE
*&
&----
*&
*&
&----
REPORT ZRE_MAINTENANCE.
data : wa_data type zlandr.
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
wa_data-bukrs = vibdpr-bukrs.
wa_data-swenr = vibdpr-swenr.
wa_data-sgrnr = vibdpr-sgrnr.
wa_data-zpnumber = zlandr-zpnum.
wa_data-xwetext = ' '.
wa_data-xgrtxt = ' '.
wa_data-zptype = zlandr-zptype.
wa_data-zpnotes = zlandr-zpnote.
case sy-ucomm.
when 'DABA'.
insert into zlandr values wa_data.
endcase.
ENDMODULE. " USER_COMMAND_1000 INPUT
&----
*& Module STATUS_1000 OUTPUT
&----
text
----
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'STATUS'.
ENDMODULE. " STATUS_1000 OUTPUT
It says vibdpr is unknown. I have named the screen input / output field as vibdpr-bukrs. Could some one help me with this issue.
Thanks in advance
Rock Pate
‎2009 May 15 4:57 PM
You have to declare table vibdpr in the program as well as the screen. They are two different things.
Rob
‎2009 May 15 5:35 PM
Hey Rob,
Now when i did everything I m getting an error as Invalid field format ( Screen Error ) I checked everything but unable to determine the cause of the error. Could you help me in this.
‎2009 May 15 5:40 PM
‎2009 May 15 6:03 PM
Yes I checked everythig i created 3 buttons for create , change , display. when I click on create its not going to PAI at all . I have created function codes for all of them in the screen painter . I am pasting you the complete code .i am unable to identify the error.
&----
*& Report ZRE_MAINTENANCE
*&
&----
*&
*&
&----
REPORT ZRE_MAINTENANCE.
data : wa_data type zlandr,
it_data type standard table of zlandr,
ok_code(4).
tables : zlandr,vibdpr.
data : bukrs like vibdpr-bukrs,
swenr like vibdpr-swenr,
sgrnr like vibdpr-sgrnr,
zpnumber like zlandr-zpnumber,
zptype like zlandr-zptype,
zpnotes like zlandr-zpnotes.
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
MODULE USER_COMMAND_1000 INPUT.
case sy-ucomm.
when 'CRET'.
wa_data-bukrs = vibdpr-bukrs.
wa_data-swenr = vibdpr-swenr.
wa_data-sgrnr = vibdpr-sgrnr.
wa_data-zpnumber = zlandr-zpnumber.
wa_data-xwetext = ' '.
wa_data-xgrtxt = ' '.
wa_data-zptype = zlandr-zptype.
wa_data-zpnotes = zlandr-zpnotes.
insert into zlandr values wa_data.
when 'CHAN'.
select single * from zlandr where bukrs = vibdpr-bukrs
and swenr = vibdpr-swenr
and sgrnr = vibdpr-sgrnr
and zpnumber = zlandr-zpnumber.
zlandr-zptype = zlandr-zptype.
zlandr-zpnotes = zlandr-zpnotes.
update zlandr.
when 'DELE'.
select single * from zlandr where bukrs = vibdpr-bukrs
and swenr = vibdpr-swenr
and sgrnr = vibdpr-sgrnr
and zpnumber = zlandr-zpnumber.
delete zlandr.
endcase.
ENDMODULE. " USER_COMMAND_1000 INPUT
I have assigned the proper function codes to all of them .
‎2009 May 15 6:52 AM
what does this mean
mara-matnr = mara-matnr.
if your text field has name mara-mantr then no need to write above statement.
‎2009 May 15 7:49 AM
Hi,
Check the element list in SE51 something you have missed there.
Also check in Pf status , in menu extras-> Active functions in current status.
Regards,
Himanshu
‎2009 May 25 6:58 AM
Hello rock_plate,
Has this already been solved? If not, try to go to the REACTION properties (near Function Codes) in your layout editor. Try to set it to 'D'. Just make sure that FunctionCodes for each button are already set. And make sure that the MODULE name you declare in PAI has INPUT in the end. (MODULE xxx INPUT.)