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

Table control

Former Member
0 Likes
581

HI ALL,

i had got a table control with 3 cols ie item material quantity

now i when i enter item number 10 , material 2000 , quantity 10000

it is working fine

but when entering another record with same item number 10 but with different material and quantity , it should give me message that the item number exist , how should i approach to this, wht is the exact code to be wriiten in PAI.

REGARDS ,

PAWAN.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
562

Hi,

In PAI u can write code like:

Save all values which are entered in the screen to an internal table.

while appending the values to the internal table check the values which are there in the work area with the values which are already there in the same internal table and display the message if a record already exist.

i got idea like this if its useful try it or else try any other option.

regards,

suresh.

6 REPLIES 6
Read only

Former Member
0 Likes
563

Hi,

In PAI u can write code like:

Save all values which are entered in the screen to an internal table.

while appending the values to the internal table check the values which are there in the work area with the values which are already there in the same internal table and display the message if a record already exist.

i got idea like this if its useful try it or else try any other option.

regards,

suresh.

Read only

0 Likes
562

hi,

but how should i write the code in PAI for that......please guide me fot the same......

data : item type ztest2-posnr,

mat type mara-matnr.

case sy-ucomm.

when 'CREATE'.

if ztest2-posnr is initial or

ztest2-matnr is initial or

ztest2-zmeng is initial.

message E003(zpawan) with 'error'.

endif.

item = ztest2-posnr mod 10.

if item ne 0.

message E000(zpawan) with 'error'.

endif.

select matnr from mara into mat where matnr = ztest2-matnr.

endselect.

if sy-subrc ne 0.

message E001(zpawan) with 'error'.

endif.

WA_TEST-POSNR = zTEST2-POSNR.

WA_TEST-MATNR = zTEST2-MATNR.

WA_TEST-ZMENG = zTEST2-ZMENG.

append wa_test to it_test.

insert into Ztest2 values wa_test.

endcase.

if sy-subrc eq 0.

message S002(zpawan) with 'success'.

endif.

regards ,

pawan

Read only

0 Likes
562

hi,

i have done some chenges to u r code itself kindly check whether it can help or not

data : item type ztest2-posnr,

mat type mara-matnr.

case sy-ucomm.

when 'CREATE'.

if ztest2-posnr is initial or

ztest2-matnr is initial or

ztest2-zmeng is initial.

message E003(zpawan) with 'error'.

endif.

item = ztest2-posnr mod 10.

if item ne 0.

message E000(zpawan) with 'error'.

endif.

select single matnr from mara into mat where matnr = ztest2-matnr.

if sy-subrc ne 0.

message E001(zpawan) with 'error'.

endif.

loop at it_test into wa_test.

if zTEST2 eq wa_test.

message E002(zpawan) with 'error'.

endif.

endloop.

WA_TEST-POSNR = zTEST2-POSNR.

WA_TEST-MATNR = zTEST2-MATNR.

WA_TEST-ZMENG = zTEST2-ZMENG.

append wa_test to it_test.

insert into Ztest3 values it_test.

endcase.

if sy-subrc eq 0.

message S002(zpawan) with 'success'.

endif.

Read only

0 Likes
562

hi,

that is working fine, when i enter 2 records in table control, it

for examle.

item material quantity

100 122 10000

100 125 2000

it gives me the error message 'with same item number'

now those records should be editable, how to do that.

regards,

pawan

Read only

0 Likes
562

Hi ,

Is it compulsory an error message or can we do that as an information message like ' duplicate record data not saved' so that it automatically takes back u to the screen .

if u need compulsory an error message then after throwing the error message u need to call the same screen back using call screen <screen no> each n every time.

regards,

suresh.

Read only

0 Likes
562

hi , thanks i had mada the changes and it is working fine.

now when i enter a record in table control it gets updated in the ztable.

but my requirement is the records which are updated in ztable should get dispalyed in another table control.

ie when i click 'BUTTON'.

now how should i approach to this , how to code this.

regards,

pawan