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

Problem in Inserting the new values into Ztable

Former Member
0 Likes
1,172

Hi Techies,

I have a requirement that when ever user enters the value in Billing Qty input which is in VF01 tcode and the table is VBRP-FKIMG, and client want billing qty and previous month reading, the fields are not in VBRP. So I have created a custom table name as YSD-EXPORT_QTY with fields of CUSTOMER, MONTH, YEAR, BILL_QTY, PREV_READING, CUMULATIVE... When ever user enter the Billing Qty I want to update database table and initally there is no data in custom table. I tried below code but i am not getting and i am getting the error as

"The type of the database table and work area (or internal table) "WA_EXPORT" are not Unicode convertible. "

So, How can I resolve this issue.. I am trying this since from 3 days... if u have any sample code please give me...

MOVE WA_VBRP-FKIMG TO WA_EXPORT-BILL_QTY.

WA_EXPORT-CUMULATIVE = WA_EXPORT-BILL_QTY + WA_EXPORT-PREV_READING.

WA_EXPORT-PREV_READING = WA_EXPORT-CUMULATIVE.

APPEND WA_EXPORT TO IT_EXPORT.

INSERT INTO YSD_EXPORT_QTY VALUES WA_EXPORT.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,135

Check the definition of the work area, should look like

DATA WA_EXPORT TYPE YSD_EXPORT_QTY.

- I hope there is a client column MANDT in the database table

- Check [Work Areas in Open SQL Statements|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm]

Regards,

Raymond

Hi Techies,

I have a requirement that when ever user enters the value in Billing Qty input which is in VF01 tcode and the table is VBRP-FKIMG, and client want billing qty and previous month reading, the fields are not in VBRP. So I have created a custom table name as YSD-EXPORT_QTY with fields of CUSTOMER, MONTH, YEAR, BILL_QTY, PREV_READING, CUMULATIVE... When ever user enter the Billing Qty I want to update database table and initally there is no data in custom table. I tried below code but i am not getting and i am getting the error as

"The type of the database table and work area (or internal table) "WA_EXPORT" are not Unicode convertible. "

So, How can I resolve this issue.. I am trying this since from 3 days... if u have any sample code please give me...

MOVE WA_VBRP-FKIMG TO WA_EXPORT-BILL_QTY.

WA_EXPORT-CUMULATIVE = WA_EXPORT-BILL_QTY + WA_EXPORT-PREV_READING.

WA_EXPORT-PREV_READING = WA_EXPORT-CUMULATIVE.

APPEND WA_EXPORT TO IT_EXPORT.

INSERT INTO YSD_EXPORT_QTY VALUES WA_EXPORT.

9 REPLIES 9
Read only

Former Member
0 Likes
1,135

Hi,

Have you tried to modify the z table using MODIFY statement?

MODIFY ysd_export_qty FROM TABLE it_export.

Regards

Vinod

Read only

0 Likes
1,135

Hi Vinod,

Actually Initially there is no data in my custom table.. I want to insert the data through program by every day...

I tried by using Modify Stmt.. it didnt worked..

Thanks in Advance..

Regards,

Murali

Read only

0 Likes
1,135

Hi Techies,

Please Help me regarding above issue cause I stucked there since from 3 days... I have tried all the ways but my table is not modifying...

Thanks n Regards,

Muralikrishna

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,136

Check the definition of the work area, should look like

DATA WA_EXPORT TYPE YSD_EXPORT_QTY.

- I hope there is a client column MANDT in the database table

- Check [Work Areas in Open SQL Statements|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm]

Regards,

Raymond

Read only

0 Likes
1,135

Hi Raymond,

Thanq for solution.. it's updating the Database but it is overriding already existing record.. but i need it to insert into my databse table...

Thanks in Advance,

Regards,

Muralikrishna

Read only

0 Likes
1,135

If it overrides existting record, you should add new key fields to your database table, there can be only one record per set of key values.

I suppose keys look like MANDT, KUNNR, GJAHR, MONAT or MANDT VBELN POSNR or a combination of both set of keys (not sure to understand you requirement)

You have to first read from database if some data already exists,

- if yes, add the new quantities and UPDATE the record

- if no, INSERT a new record

Remember keys define a unique record, and cannot be updated once inserted.

If your program should never update records, add a "technical" key field, and fill it using a timestamp or a number range counter (FM NUMBER_GET_NEXT)

Regards,

Raymond

Read only

0 Likes
1,135

Hi Raymond,


If your program should never update records, add a "technical" key field, and fill it using a timestamp or a number range counter.

I am not getting this point. If you dont mine can you eloberate it please.

Thanks in Advance

Regards,

Muralikrishna

Read only

0 Likes
1,135

Suppose you want to keep a log per customer order, the key fields MANDT, VBELN wont be sufficient as only one record can be recorder per order, so you add another key, say CPUDT and CPUTM, so you are able to store the log whenever user changes any value.

Regards,

Raymond

Read only

0 Likes
1,135

Hi Raymond,

My apology for not being able to understand, I am a fresher and i hope u understand. Please guide me why do we need to maintain the log for the customers order?

I would like to update the records using a program, when ever user enters the value of VBELN(input) then updations can be done in custom table.

Thanks in Advance,

Regards,

Murali