‎2007 Apr 16 6:58 PM
I need to update infotype table paXXXX but i only know the infotype number at runtime.
Is there any way i can write an UPDATE statement at runtime??
‎2007 Apr 16 7:03 PM
How are you doing the UPDATE ? direct db or function call.. either way, you can adopt the logic used for dynamic internal tables.. ( Pl search the forum with key phrase ' dynamic internal tables' )..
~Suresh
‎2007 Apr 16 9:08 PM
I'm doing the update directy.
Is there a standard function call that also implements update database operation???
i'm doing
UPDATE PAXXXX WHERE condition
The table name can change.
‎2007 Apr 16 7:23 PM
Read my weblog <a href="/people/alvaro.tejadagalindo/blog/2006/03/03/tasting-the-mix-of-php-and-sap--volume-2 the mix of PHP and SAP - Volume 2</a> my custom FM <b>ZRFC_TABLE_OPERATIONS_LINE</b> might help you -:)
Greetings,
Blag.
‎2007 Apr 16 9:30 PM
Use the following standard SAP program as a reference to generate dynamic conditions in SQL.
REPORT demo_select_dynamic_conditions .
DATA: cond(72) TYPE c,
itab LIKE TABLE OF cond.
PARAMETERS: city1(10) TYPE c, city2(10) TYPE c.
DATA wa TYPE spfli-cityfrom.
CONCATENATE 'CITYFROM = ''' city1 '''' INTO cond.
APPEND cond TO itab.
CONCATENATE 'OR CITYFROM = ''' city2 '''' INTO cond.
APPEND cond TO itab.
CONCATENATE 'OR CITYFROM = ''' 'BERLIN' '''' INTO cond.
APPEND cond TO itab.
LOOP AT itab INTO cond.
WRITE cond.
ENDLOOP.
SKIP.
SELECT cityfrom
INTO wa
FROM spfli
WHERE (itab).
WRITE / wa.
ENDSELECT.
I hope that this will help you.
Regards,
Amey