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

I need insert /update/modify ztable from internal table or work area

Former Member
0 Likes
1,679

I have one simple problem.

TYPES: BEGIN OF t_account,

acc_no LIKE zztaccountheader-acc_no,

cust_id LIKE zztaccountheader-cust_id,

acc_type LIKE zztaccountheader-acc_type,

od_option LIKE zztaccountheader-od_option,

od_limit LIKE zztaccountheader-od_limit,

od_issue_date LIKE zztaccountheader-od_issue_date,

END OF t_account.

data: lwa_account TYPE t_account,

li_account TYPE STANDARD TABLE OF t_account,

bu scerrin i am inputing data :

i want modify updare or insert record into ztable by work area i put following thing

MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,

zztcustomer-cust_id TO lwa_account-cust_id,

zztaccountheader-acc_type TO lwa_account-acc_type,

zztaccountheader-od_option TO lwa_account-od_option,

zztaccountheader-od_limit TO lwa_account-od_limit,

zztaccountheader-od_issue_date TO lwa_account-od_issue_date.

INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .

CLEAR lwa_account.

ENDIF.

i am etting error

The type of the database table and work area (or internal table)

"LWA_ACCOUNT" are not Unicode convertible.

please solve it

I have one simple problem.

TYPES: BEGIN OF t_account,

acc_no LIKE zztaccountheader-acc_no,

cust_id LIKE zztaccountheader-cust_id,

acc_type LIKE zztaccountheader-acc_type,

od_option LIKE zztaccountheader-od_option,

od_limit LIKE zztaccountheader-od_limit,

od_issue_date LIKE zztaccountheader-od_issue_date,

END OF t_account.

data: lwa_account TYPE t_account,

li_account TYPE STANDARD TABLE OF t_account,

bu scerrin i am inputing data :

i want modify updare or insert record into ztable by work area i put following thing

MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,

zztcustomer-cust_id TO lwa_account-cust_id,

zztaccountheader-acc_type TO lwa_account-acc_type,

zztaccountheader-od_option TO lwa_account-od_option,

zztaccountheader-od_limit TO lwa_account-od_limit,

zztaccountheader-od_issue_date TO lwa_account-od_issue_date.

INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .

CLEAR lwa_account.

ENDIF.

i am etting error

The type of the database table and work area (or internal table)

"LWA_ACCOUNT" are not Unicode convertible.

please solve it

5 REPLIES 5
Read only

Former Member
0 Likes
886

Why cant you try out the MODIFY statement instead?

MODIFY ITAB FROM wa

Read only

Former Member
0 Likes
886

Hi,

The work area should be the same type as the table into which you need to update it.

for this just do the following changes

<b>lwa_account TYPE zztaccountheader,</b>

<b>INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .</b>

This should solve your problem

Read only

Former Member
0 Likes
886

when you use insert statement to update database table both the structures should be different

TYPES: BEGIN OF t_account.
         INCLUDE STRUCTURE zztaccountheader.
TYPES: END OF t_account.

data: lwa_account TYPE t_account.

Read only

anversha_s
Active Contributor
0 Likes
886

hi,

decalre like this.

tables : zztaccountheader.

data : t_account like zztaccountheader occurs 0 with header line.

data: lwa_account TYPE t_account,

li_account TYPE STANDARD TABLE OF t_account,

MOVE : zztaccountheader-acc_no TO lwa_account-acc_no,

zztcustomer-cust_id TO lwa_account-cust_id,

zztaccountheader-acc_type TO lwa_account-acc_type,

zztaccountheader-od_option TO lwa_account-od_option,

zztaccountheader-od_limit TO lwa_account-od_limit,

zztaccountheader-od_issue_date TO lwa_account-od_issue_date.

INSERT zztaccountheader CLIENT SPECIFIED FROM lwa_account .

CLEAR lwa_account.

ENDIF.

rgss

anver

if hlped mark points

Read only

Former Member
0 Likes
886

HI,

You have to put all data into your internal table from your workarea and then you have to apply modify command.


MOVE : '1'o TO lwa_account-acc_no,
'aaa' TO lwa_account-cust_id,
'abc' TO lwa_account-acc_type,
'Yes' TO lwa_account-od_option,
'10000' TO lwa_account-od_limit,
'01012006' TO lwa_account-od_issue_date.
append lwa_account to li_account
CLEAR lwa_account.
modify zztaccountheader from table li_account.

regards,

Raghav