Application Development and Automation 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: 
Read only

dialog programming doubt

Former Member
0 Likes
1,218

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,156

Hi,

Check the Screen fields and Field attributes on the screen.you might be missing some thing.

Read only

Former Member
0 Likes
1,156

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.

Read only

0 Likes
1,156

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

Read only

0 Likes
1,156

You have to declare table vibdpr in the program as well as the screen. They are two different things.

Rob

Read only

0 Likes
1,156

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.

Read only

0 Likes
1,156

Did you go into the layout editor and check the screen?

Rob

Read only

0 Likes
1,156

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 .

Read only

Former Member
0 Likes
1,156

what does this mean

mara-matnr = mara-matnr.

if your text field has name mara-mantr then no need to write above statement.

Read only

Former Member
0 Likes
1,156

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

Read only

Former Member
0 Likes
1,156

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.)