Application Development 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: 

doubt in dialoug programing

Former Member
0 Kudos

hi friends,

I tried creatig a Dialog program , for entering employee details.

I created my own table zpkemp1, but when i tried activating my program i wasnt able to do soo.

it says : "zpkemp1 must be a flat structure. you canoot use internal tables,strings, reference and structures.

CAn anyone helpo me to proceed with this task.

Thanks&Regards

Rinky123

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You must be trying to update the table the wrong way. can you please post the relevant code where you are trying to update the table? Or where the zpkemp1 is being used in the code?

Regards,

Rich Heilman

0 Kudos

Hi rich,

This is my code.plz chk with it

&----


*& Module pool Z_PK_DIALOG1 *

*& *

&----


*& *

*& *

&----


PROGRAM Z_PK_DIALOG1.

TABLES : ZPKEMP1.

DATA : t1 like zpkemp1-zpkempno.

t2 like zpkemp1-zpkfn.

t3 like zpkemp1-zpkln.

t4 like zpkemp1-zpkdob

t5 like zpkemp1-zpkhd.

DATA : OKCODE LIKE sy-ucomm.

INCLUDE Z_PK_TOP . " global Data

  • INCLUDE Z_PK_O01 . " PBO-Modules *

  • INCLUDE Z_PK_I01 . " PAI-Modules *

  • INCLUDE Z_PK_F01 . " FORM-Routines *

&----


*& Module STATUS_0010 OUTPUT

&----


  • text

----


module STATUS_0010 output.

SET PF-STATUS 'ZPKMENU'.

SET TITLEBAR '001'.

endmodule. " STATUS_0010 OUTPUT

&----


*& Module USER_COMMAND_0010 INPUT

&----


  • text

----


module USER_COMMAND_0010 input.

CASE OKCODE.

When 'SAVE'.

zpkemp1-zpkempno = t1.

zpkemp1-zpkfn = t2.

zpkemp1-zpkln = t3.

zpkemp1-zpdob = t4.

zpkemp1-zpkhd= t5.

insert zpkemp1.

when 'BACK'.

set screen 0.

leave screen.

when 'EXIT' or 'CANCEL'

Leave Program.

endcase.

endmodule. " USER_COMMAND_0010 INPUT

0 Kudos

Please try this.



<b>*tables : zpkemp1.   " comment this out</b>

data : t1 <b>Type</b> zpkemp1-zpkempno.
t2 <b>Type</b> zpkemp1-zpkfn.
t3 <b>Type</b> zpkemp1-zpkln.
t4 <b>Type</b> zpkemp1-zpkdob
t5 <b>Type</b> zpkemp1-zpkhd.
<b>data: xzpkemp1 type zpkemp1.</b>
data : okcode like sy-ucomm.










include z_pk_top . " global Data

* INCLUDE Z_PK_O01 . " PBO-Modules *
* INCLUDE Z_PK_I01 . " PAI-Modules *
* INCLUDE Z_PK_F01 . " FORM-Routines *

*&---------------------------------------------------------------------*
*& Module STATUS_0010 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module status_0010 output.
  set pf-status 'ZPKMENU'.
  set titlebar '001'.

endmodule. " STATUS_0010 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0010 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module user_command_0010 input.

  case okcode.

    when 'SAVE'.

<b>      xzpkemp1-zpkempno = t1.
      xzpkemp1-zpkfn = t2.
      xzpkemp1-zpkln = t3.
      xzpkemp1-zpdob = t4.
      xzpkemp1-zpkhd= t5.

      insert zpkemp1 from xzpkemp1.</b>

    when 'BACK'.

      set screen 0.
      leave screen.

    when 'EXIT' or 'CANCEL'

    leave program.
  endcase.

endmodule. " USER_COMMAND_0010 INPUT

Regards,

Rich Heilman