10-11-2010 6:15 AM
Dear gurus
i have created a program which should modify transparent table from itab.
below is the code i have written
LOOP AT itab.
itab-prior = 1.
itab-aedtm = sy-datum.
SELECT SINGLE kunnr INTO itab-kunnr
FROM vbak
WHERE vbeln = itab-kdauf.
SELECT SINGLE vkorg vtweg spart
INTO (vkorg, vtweg , spart)
FROM vbak
WHERE vbeln = itab-kdauf.
SELECT SINGLE name1 FROM kna1
INTO itab-name1
WHERE kunnr = itab-kunnr.
SELECT SINGLE fbuda INTO fbuda
FROM vbkd
WHERE vbeln = itab-kdauf AND
posnr = itab-kdpos.
itab-ddate = fbuda.
SELECT SINGLE cuobj kwmeng INTO (cuobj , itab-kwmeng)
FROM vbap WHERE
vbeln = itab-kdauf AND
* werks = itab-plant or
vstel = itab-plant AND
posnr = itab-kdpos AND
abgru = space.
CALL FUNCTION 'CUCB_GET_CONFIGURATION'
EXPORTING
instance = cuobj
IMPORTING
ibase = ibase
configuration = config
eo_cbase_ref = cbase
EXCEPTIONS
invalid_input = 1
invalid_instance = 2
instance_is_a_classification = 3
OTHERS = 4.
IF sy-subrc = 0.
LOOP AT config INTO wa_config.
LOOP AT wa_config-values INTO wa_values.
SELECT SINGLE atnam FROM cabn INTO charname
WHERE atinn = wa_values-atinn AND
adzhl = '0000'.
IF sy-subrc = 0.
IF charname+0(8) = 'REELSIZE'.
size = wa_values-atflv.
ELSEIF charname+0(6) = 'LENGTH'.
alength = wa_values-atflv.
ELSEIF charname+0(9) = 'THICKNESS'.
thickness = wa_values-atflv.
ELSEIF charname+0(7) = 'DENSITY'.
density = wa_values-atflv.
ELSEIF charname+0(8) = 'CORE_DIA'.
coredia = wa_values-atflv.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
itab-size = size.
itab-alength = alength.
itab-thickness = thickness.
itab-density = density.
itab-coredia = coredia.
itab-psttr = itab-aedtm.
itab-pedtr = itab-aedtm + 1.
SELECT SINGLE untto uebto
INTO (itab-untto , itab-uebto)
FROM knvv
WHERE kunnr = itab-kunnr
AND vkorg = vkorg
AND vtweg = vtweg
AND spart = spart.
itab-totswt = itab-pkwmeng + ( itab-pkwmeng / itab-totwt * itab-trimwgt ).
MOVE-CORRESPONDING itab TO zslitorders.
MODIFY zslitorders.
MOVE-CORRESPONDING itab TO zslitplan.
MODIFY zslitplan.
MODIFY itab.
ENDLOOP.
if the data in itab is having only one line item then the table ZSLITORDERS is modified but when the itab is having multiple line item the report is throwing a dump
Database error text........: "Numeric overflow for parameter/column (42)"
Internal call code.........: "[RSQL/178/ZSLITORDERS ]"
Please check the entries in the system log (Transaction SM21).
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"DBIF_RSQL_SQL_ERROR" "CX_SY_OPEN_SQL_DB"
"ZSNAK_PP_MANUAL_PLANNING" or "ZSNAK_PP_MANUAL_PLANNING"
"START-OF-SELECTION"
Regards
Saad Nisar
10-11-2010 6:42 AM
Hi Saad,
Pls use MODIFY zslitorders FROM TABLE itab for multiple line item
Press F1 on MODIFY
10-11-2010 6:42 AM
Hi Saad,
Pls use MODIFY zslitorders FROM TABLE itab for multiple line item
Press F1 on MODIFY
10-11-2010 7:47 AM
Hi,
The problem mostly is with the usage of the function module(FM). These kind of functional area, specific error messages won't appear for general SQL statements.
Read the usage document of the FM 'CUCB_GET_CONFIGURATION' and try to use it in a different way by adjusting the parameters for the FM (or) you can try out, other alternate FMs for meeting the same requirement.
Regards,
Kumaar
10-11-2010 8:59 AM
Hi,
ZSLITORDER is a work area and it will contain multiple values. So, if you update multiple values, then you need to update it using an internal table.
Use the following command ; MODIFY target FROM source.
You can have a look at the documentation.
Thanks and Regards,
Samantak.