06-28-2007 10:06 AM
Hi,
When i execute this code(below), I am getting an error called "Argument does not exist in the table"?
can any one say, what would be the problem.
Vijayanand
**********************************************************************************************
LOOP AT GT_FLAT INTO GX_FLAT.
GV_INDEX = SY-TABIX + 1.
ON CHANGE OF GX_FLAT-MATNR.
*-----POPULATING THE ITEM INFORMATION
MATNR_N = GX_FLAT-MATNR.
GX_ITEMS-MATERIAL = MATNR_N.
SELECT SINGLE WERKS FROM MARC
INTO WERKS
WHERE MATNR = GX_ITEMS-MATERIAL.
GX_ITEMS-PLANT = WERKS.
GX_ITEMS-REQU_TYPE = '001'.
GX_ITEMS-VERSION = 'GP'.
ENDON.
GT_SCHEDULE-DATE_TYPE = '3'.
GT_SCHEDULE-REQ_DATE = GX_FLAT-EDATU.
GT_SCHEDULE-REQ_QTY = GX_FLAT-PLNMG.
APPEND GT_SCHEDULE.
CLEAR: GT_SCHEDULE.
LOOP AT GT_FLAT TRANSPORTING NO FIELDS FROM GV_INDEX WHERE MATNR = GX_FLAT-MATNR.
ENDLOOP.
IF SY-SUBRC <> 0.
CALL FUNCTION 'BAPI_REQUIREMENTS_CREATE'
EXPORTING
REQUIREMENTS_ITEM = GX_ITEMS
REQUIREMENT_PARAM =
DO_COMMIT = 'X'
UPDATE_MODE = 'X'
REFER_TYPE = ' '
PROFILID = ' '
IMPORTING
MATERIAL =
PLANT =
REQUIREMENTSTYPE =
VERSION =
REQMTSPLANNUMBER =
MRP_AREA =
MATERIAL_EVG =
TABLES
REQUIREMENTS_SCHEDULE_IN = GT_SCHEDULE
REQUIREMENTS_CHAR_IN =
RETURN = GT_RETURN.
LOOP AT GT_RETURN WHERE TYPE = 'E' OR TYPE = 'A'.
ENDLOOP.
IF SY-SUBRC <> 0 AND GT_RETURN IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSEIF SY-SUBRC = 0.
LOOP AT GT_RETURN.
WRITE:/ GT_RETURN-MESSAGE.
ENDLOOP.
ENDIF.
REFRESH GT_SCHEDULE.
ENDIF.
ENDLOOP.
06-28-2007 11:44 AM
Hi,
That means you are missing a parameter in the bapi .
please fill that before proceeding.The better way is to read the documnetation for this bapi which clearly says what needs to be passed.
see the following code and compare with urs
l_bapisshdin-date_type = c_3. "Date type
l_bapisshdin-req_date = l_temp_wdate. "Schedule line date
l_bapisshdin-req_qty = rec_mat-quty. "Planned quantity
APPEND l_bapisshdin TO l_i_bapisshdin.
l_bapisitemr-material = rec_mat-matnr.
l_bapisitemr-plant = p_s_werks.
l_bapisitemr-requ_type = c_lsf.
l_bapisitemr-version = p_s_versb.
l_bapisitemr-REQ_NUMBER = space.
CALL FUNCTION 'BAPI_REQUIREMENTS_CREATE'
EXPORTING
requirements_item = l_bapisitemr
TABLES
requirements_schedule_in = l_i_bapisshdin
return = l_i_bapireturn1.
hope this will help u.
Regards,
sasi
06-28-2007 11:44 AM
Hi,
That means you are missing a parameter in the bapi .
please fill that before proceeding.The better way is to read the documnetation for this bapi which clearly says what needs to be passed.
see the following code and compare with urs
l_bapisshdin-date_type = c_3. "Date type
l_bapisshdin-req_date = l_temp_wdate. "Schedule line date
l_bapisshdin-req_qty = rec_mat-quty. "Planned quantity
APPEND l_bapisshdin TO l_i_bapisshdin.
l_bapisitemr-material = rec_mat-matnr.
l_bapisitemr-plant = p_s_werks.
l_bapisitemr-requ_type = c_lsf.
l_bapisitemr-version = p_s_versb.
l_bapisitemr-REQ_NUMBER = space.
CALL FUNCTION 'BAPI_REQUIREMENTS_CREATE'
EXPORTING
requirements_item = l_bapisitemr
TABLES
requirements_schedule_in = l_i_bapisshdin
return = l_i_bapireturn1.
hope this will help u.
Regards,
sasi
06-28-2007 1:16 PM
Dear Sasi,
I hope that only difference between ur's and my program is
l_bapisitemr-REQ_NUMBER = space.
is missing.
I have added it, But still the same problem.
The message in RETURN-MESSAGE = 'Argument does not exits in the table'.
Vijayanand
06-28-2007 2:11 PM
Hi,
Can you check the date format that u r passing into schedule lines or do one thing put a break point in the fm where this error message is coming and check near which data the error is coming.Because its working fine in my case.
Regards,
sasi
06-28-2007 6:48 PM
Hi Vijay,
I think you are missing Unit of Measurement. Pass this as well into the Schedule table (BAPISSHDIN).
Thanks & Regards,
Sandip Kamdar