‎2009 Nov 05 11:31 AM
Hi,
I want to send data in internal table to a custom Z-table through a report program. How can I do this?
Thanks in advance.
‎2009 Nov 05 12:00 PM
Hi,
Just refer the code I have posted, & try coding your code according to your requirement. You will find an answer.
Otherwise write the details of your requirement, will suggest you an exact anwer.
Regards
Abhii...
‎2009 Nov 05 11:34 AM
Hi,
Please search on SCN. You will get many threads.
Or write Insert and press F1 in abap editor.
Insert statement is used for this purpose.
Regards,
Dhan
‎2009 Nov 05 11:36 AM
Hi,
You can use INSERT statement to do the same.
Please refer below code for reference :-
DATA: wa TYPE scustom.
wa-id = '12400177'.
wa-name = 'Robinson'.
wa-postcode = '69542'.
wa-city = 'Heidelberg'.
wa-custtype = 'P'.
wa-discount = '003'.
wa-telephone = '06201/44889'.
INSERT INTO scustom VALUES wa.
Please set to resolved if it answers your question.
‎2009 Nov 05 11:37 AM
Hi,
Create internal table of type z custom table.
populate the data into internal table.
then...
insert Zcutom from table internal_table.
thnx
RK
‎2009 Nov 05 11:39 AM
Hi K V Subbarao,
I guess your requirement is to save the data present in internal table into a custom table.
If so,
create the internal table type as custom z table and use the INSERT command to create entries in the z table.
‎2009 Nov 05 12:00 PM
Hi,
Just refer the code I have posted, & try coding your code according to your requirement. You will find an answer.
Otherwise write the details of your requirement, will suggest you an exact anwer.
Regards
Abhii...
‎2009 Nov 05 12:09 PM
Hi
I have written this code:
LOOP AT it_status INTO wa_status.
IF wa_status-m_typ = 'E'.
wa_ztable-mandt = sy-mandt.
wa_ztable-aufnr = wa_status-aufnr.
wa_ztable-objnr = wa_status-objnr.
wa_ztable-charg = wa_status-charg.
wa_ztable-matnr = wa_status-matnr.
wa_ztable-autyp = wa_status-autyp.
wa_ztable-auart = wa_status-auart.
wa_ztable-m_typ = wa_status-m_typ.
wa_ztable-msg = wa_status-msg.
wa_ztable-user_id = sy-uname.
wa_ztable-date_occur = sy-datum.
wa_ztable-aufnr = sy-uzeit.
INSERT into zqm_qn_testorder values wa_ztable.
CLEAR wa_ztable.
ENDIF.
ENDLOOP.
But the records are not appended.
The database table zqm_qn_testorder doesn't have a table maintainence generator created.
Is it require to create parameter transaction and then pass these vales by calling the transaction?
Thanks.
‎2009 Nov 05 12:15 PM
just get all teh data into one internla table like ..
gt_ztable ...
like...
LOOP AT it_status INTO wa_status.
IF wa_status-m_typ = 'E'.
wa_ztable-mandt = sy-mandt.
wa_ztable-aufnr = wa_status-aufnr.
wa_ztable-objnr = wa_status-objnr.
wa_ztable-charg = wa_status-charg.
wa_ztable-matnr = wa_status-matnr.
wa_ztable-autyp = wa_status-autyp.
wa_ztable-auart = wa_status-auart.
wa_ztable-m_typ = wa_status-m_typ.
wa_ztable-msg = wa_status-msg.
wa_ztable-user_id = sy-uname.
wa_ztable-date_occur = sy-datum.
wa_ztable-aufnr = sy-uzeit.
append wa_ztable to gt_table.
CLEAR wa_ztable.
ENDIF.
ENDLOOP.
if gt_table[] is not initial.
insert zcustom_table from table gt_table.
endif.
thats it...
Thanks
RK
‎2009 Nov 05 12:16 PM
‎2009 Nov 05 12:20 PM
Hi,
Use Rahul Keshav code and have a COMMIT WORK. after the insert .
Then the database will get modified
Thanks
‎2009 Nov 05 12:36 PM
Hi
Thanx I have solved the proble. The error is
wa_ztable-time_occur = sy-uzeit.
here. the field name should be this but initally I had given key field aufnr and hence data is not posted properly.
Thax once again.