‎2014 Nov 12 4:30 AM
Dear All,
I am facing issue with one of module pool programming. My First screen is given below.
What exactly i am looking for, in our next screen we will add some detail and same should be added in the next screen in the next line.
Now after adding these details, new line should be inserted in the next screen.and also the same should be updated in the next line of z-table. But right now its showing the current record only. not adding the next line with new record.
3rd screen is like this, but not inserting the records that we have added.
Thanks and regards
Jai
‎2014 Nov 12 4:37 AM
‎2014 Nov 12 4:50 AM
Hi Ranju,
Kindly chk the code.
BREAK-POINT.
LOOP AT it_zexp_advice INTO wa_zexp_advice.
* DELETE it_zexp_advice WHERE eano IS INITIAL.
lwa_expadvice-eorder = wa_zexp_advice-eorder.
lwa_expadvice-buyer = wa_zexp_advice-buyer.
lwa_expadvice-buyer_code = wa_zexp_advice-buyer_code.
lwa_expadvice-containers = wa_zexp_advice-containers.
lwa_expadvice-dispatch_sch = wa_zexp_advice-dispatch_sch.
lwa_expadvice-last_date_dispatch = wa_zexp_advice-last_date_dispatch.
lwa_expadvice-basic_artwork = wa_zexp_advice-basic_artwork.
lwa_expadvice-ty_pack_mat = wa_zexp_advice-ty_pack_mat.
lwa_expadvice-packing_date_bags = wa_zexp_advice-packing_date_bags.
lwa_expadvice-best_bfr_bags = wa_zexp_advice-best_bfr_bags.
lwa_expadvice-crop_year_bags = wa_zexp_advice-crop_year_bags.
lwa_expadvice-batch_bags = wa_zexp_advice-batch_bags.
lwa_expadvice-barcode_bags = wa_zexp_advice-barcode_bags.
lwa_expadvice-tag_bags = wa_zexp_advice-tag_bags.
lwa_expadvice-stitching = wa_zexp_advice-stitching.
lwa_expadvice-stickers = wa_zexp_advice-stickers.
lwa_expadvice-fumigation = wa_zexp_advice-fumigation.
lwa_expadvice-inner_bag = wa_zexp_advice-inner_bag.
lwa_expadvice-seal = wa_zexp_advice-seal.
lwa_expadvice-empty_bags = wa_zexp_advice-empty_bags.
lwa_expadvice-sample_pre_shipment = wa_zexp_advice-sample_pre_shipment.
lwa_expadvice-sample_post_shipment = wa_zexp_advice-sample_post_shipment.
lwa_expadvice-sample_oaa = wa_zexp_advice-sample_oaa.
lwa_expadvice-third_party_ins = wa_zexp_advice-third_party_ins.
lwa_expadvice-blank1 = wa_zexp_advice-blank1.
lwa_expadvice-blank2 = wa_zexp_advice-blank2.
lwa_expadvice-blank3 = wa_zexp_advice-blank3.
lwa_expadvice-blank4 = wa_zexp_advice-blank4.
lwa_expadvice-blank5 = wa_zexp_advice-blank5.
lwa_expadvice-prepared_by = wa_zexp_advice-prepared_by.
lwa_expadvice-prepared_date = wa_zexp_advice-prepared_date.
lwa_expadvice-approved_by = wa_zexp_advice-approved_by.
lwa_expadvice-approved_date = wa_zexp_advice-approved_date.
lwa_expadvice-ppc = wa_zexp_advice-ppc.
lwa_expadvice-eano = wa_zexp_advice-eano.
lwa_expadvice-others_txt = wa_zexp_advice-others_txt.
lwa_expadvice-other_name = wa_zexp_advice-other_name.
lwa_expadvice-zprirority = wa_main1-zprirority.
lwa_expadvice-zplant = wa_main1-zplant.
* MODIFY zexp_advice FROM lwa_expadvice.
APPEND lwa_expadvice TO lt_expadvice.
INSERT zexp_advice FROM lwa_expadvice.
Thanks and Regards
Jai
‎2014 Nov 12 5:03 AM
HI
You are updating the Z-table through workarea, so once try with MODIFY keyword.
regards
laxman
‎2014 Nov 12 5:06 AM
Hi Laxman,
With Modify command, i am not in a position to add a new record in the next line.
Thanks and regards
Jai
‎2014 Nov 12 4:56 AM
Hi Jaiprakash,
Did you check your internal table for table control?
All records are there in internal table? Still displaying only single record?
Then add this piece of code before loop endloop, at PBO of screen having table control.
DESCRIBE TABLE itab LINES tbc-lines.
Regards
Sreekanth
‎2014 Nov 12 5:08 AM
Hi Sreekanth,
I have only added record in the internal table. and i am not able to get 2nd line in the internal table.
Thanks and regards
Jai
‎2014 Nov 12 5:30 AM
Hi,
Please check the select statement for the 3rd screen whether it is triggered after the insert statement which you mentioned above.
If you are trying to update the non-primary key and if the primary key remains the same of the new record, use MODIFY. Otherwise, use insert.
It is better if you can collect the details inside the loop in an internal table , if possible and then modify/insert using the internal table than the work area.
‎2014 Nov 12 5:34 AM
I didn't get you. You mean to say, APPEND lwa_expadvice TO lt_expadvice is not working?
‎2014 Nov 12 6:15 AM
Hi Sreekanth,
Append is working but properly, its showing the data in the internal table. But Insert statement is not adding the record in the next line.
Refer the below screen shot.
INSERT zexp_advice FROM lwa_expadvice . statement is not adding data into table control as well as in our z-table zexp_advice.
Thanks and Regards
Jai
‎2014 Nov 12 6:20 AM
Hi Jai,
Fill MANDT in lwa_expadvice with sy-mandt value. Also make sure that the same key is not there in your table.
Regards
Sreekanth
‎2014 Nov 12 7:16 AM
Hi
make sure that the internal table you are using for table control in 3rd screen is lt_expadvice or not.
and according to your screen shots in that internal table having one record only so it wil display one record.
i think you are using other internal table for fist screen.
make sure both are same.
regards
laxman
‎2014 Nov 12 6:06 AM
Hi ,
Check your table primary keys seems like you have only Export Advice No as key field.
once check the table key conditions might be issue there .
Regards,
Pavan
‎2014 Nov 12 6:17 AM
Dear Pavan,
I have checked with the condition. but i think there is no any issue with the conditions.
Thanks and regards
Jai
‎2014 Nov 12 6:12 AM
hi jaiprakash,
when record in inserted you have to refresh also
REFRESH CONTROL 'TAB_CTRL' FROM SCREEN 9001
Please check.
‎2014 Nov 12 6:24 AM
Dear Abdul,
Even though, i have used the refresh control, but still that is nor working.
Thanks and Regards
Jai
‎2014 Nov 12 8:47 AM
Hi jaiprakash,
please check whether plant and priority rae primary keys or not.
Regards.
Sridhar.A
‎2014 Nov 12 9:21 AM
hi,
First you insert the record into the ztable and then append it to the internal table..
else you try with the update statement it may help you
‎2014 Nov 12 11:43 AM
Dear all,
I have tried everything, but its not working.
Thanks and regards
Jai