2013 Apr 03 11:26 AM
hi friends,
iam write the bdc uploading program for transaction fd32, in this uploading file iam having fields below like this
customerno controlarea creditlimit
1 1000 30000
2 1000 5000
based upon uploading file(customer number), i want to select the data from CDPOS table based on customer number in cdpos table having same customer multiple records, but i want first record new_value only?
iam trying different types of select statements but it is not working, i didnt get the data from database. if anybody know please tell me.
2013 Apr 03 11:54 AM
Hi,
Add leading zero's to the Customer Numbers from file.
Then for all those Customer Number access CDPOS table by below select statement.
SELECT *
FROM CDPOS
INTO TABLE lt_cdpos
FOR ALL ENTRIES IN lt_file
WHERE OBJECTCLAS = 'KLIM'
AND OBJECTID = lt_file-kunnr
AND TABNAME = 'KNKK'
AND FBAME = 'KLIMK'
AND VALUE_NEW <> space.
IF sy-subrc = 0.
SORT lt_cdpos.
ENDIF.
Thanks & Regards
Bala Krishna
2013 Apr 03 11:53 AM
Hi Priya,
Please select first than sorting by DESCENDING .Than u have to read it.Than u will get the Current data.
Thanks
Tarak
2013 Apr 03 11:54 AM
Hi,
Add leading zero's to the Customer Numbers from file.
Then for all those Customer Number access CDPOS table by below select statement.
SELECT *
FROM CDPOS
INTO TABLE lt_cdpos
FOR ALL ENTRIES IN lt_file
WHERE OBJECTCLAS = 'KLIM'
AND OBJECTID = lt_file-kunnr
AND TABNAME = 'KNKK'
AND FBAME = 'KLIMK'
AND VALUE_NEW <> space.
IF sy-subrc = 0.
SORT lt_cdpos.
ENDIF.
Thanks & Regards
Bala Krishna
2013 Apr 03 12:11 PM
hi it will show error message like this...
when we are using for 'all entries in tab' the field objectid and it_tab-kunnr must have the same type ans same length
2013 Apr 03 4:19 PM
Create a new internal table with only one field and move all the customer numbers into that and use that table.
Ex:-
TYPES : BEGIN OF ty_kunnr,
kunnr TYPE cdpos-objectid,
END OF ty_kunnr.
DATA : lt_kunnr TYPE STANDARD TABLE OF ty_kunnr,
wa_kunnr TYPE ty_kunnr.
LOOP AT lt_file INTO wa_file.
wa_kunnr-kunnr = wa_file-kunnr.
ENDLOOP.
* Then use select.
SELECT *
FROM CDPOS
INTO TABLE lt_cdpos
FOR ALL ENTRIES IN lt_kunnr
WHERE OBJECTCLAS = 'KLIM'
AND OBJECTID = lt_kunnr-kunnr
AND TABNAME = 'KNKK'
AND FBAME = 'KLIMK'
AND VALUE_NEW <> space.
IF sy-subrc = 0.
SORT lt_cdpos.
ENDIF.
Thanks and Regards
Bala Krishna
2013 Apr 03 12:02 PM
Hi,
try control break statements in loop.
LOOP AT ITAB.
AT NEW customer no
perform fill_screen_details.
perform fill_field_details.
endat.
ENDLOOP.
Or if your flat is an excel type,put filter to customer no and take the req data and upload ..
2013 Apr 03 12:33 PM
hi, uploading is working but my is not uploading,
in uploading file iam having customer number i want to select the data from cdpos (FIELD- VALUE_NEW) table where customernumber is same.
and then cdpos table value_new field having some amount, now i want to calculate the % cdpos value_new and Uploading file credit limit value, if percentage is 10% i want uploading data successfully, otherwise it will show error message it will not uploaded.