Application Development 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: 

SAP to SAS system data transfer

Former Member
0 Kudos

Hello All......

I am having a reuirment as transfering the SAP data to SAS system. SAS system is having orical data base.

Connecting the external system and inserting the data directly to the SAS orical data base and the disconnecting the system.

I am using below code for updating the data.

EXEC SQL.

CONNECT TO : dbcon

ENDEXEC.

EXEC SQL.

INSERT INTO S_t001

(mandt, bukrs)

VALUES

(wa_t001-mandt, wa_t001-bukrs);

ENDEXEC.

EXEC SQL.

DISCONNECT :dbcon

ENDEXEC.

Please let me know. it would work or not. Please let me know if any other soultion is there................

Thanks,

Feroz.

1 ACCEPTED SOLUTION

matt
Active Contributor
0 Kudos

>

> Please let me know. it would work or not. Please let me know if any other soultion is there................

>

> Thanks,

> Feroz.

Why not try it and see? On the face of it, it looks ok.

3 REPLIES 3

matt
Active Contributor
0 Kudos

>

> Please let me know. it would work or not. Please let me know if any other soultion is there................

>

> Thanks,

> Feroz.

Why not try it and see? On the face of it, it looks ok.

Former Member
0 Kudos

I am getting an error as An SQL error has occurred : ORA-00911: Invalid Character.

This means table is not been created in SAS systerm or any other parameter need to be passed??????

matt
Active Contributor
0 Kudos

Why didn't you say so in the first place?

Anyway. You're syntax seems to be wrong. ABAP variables need to be preceded with a colon :

Also, you have : dbcon There shouldn't be a space. See this from SAP HELP.

PARAMETERS: p_carrid TYPE spfli-carrid, 
            p_connid TYPE spfli-connid. 

DATA: BEGIN OF wa, 
        cityfrom TYPE spfli-cityfrom, 
        cityto   TYPE spfli-cityto, 
      END OF wa. 

EXEC SQL. 
  SELECT cityfrom, cityto 
         INTO :wa 
         FROM spfli 
         WHERE carrid = :p_carrid AND connid = :p_connid 
ENDEXEC.