Application Development and Automation 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: 
Read only

report

Former Member
0 Likes
405

i have one alv report output like

kunnr city plant

0000 iiiii 255

and also i want to upload all these data into sql server, how to proceed ?

3 REPLIES 3
Read only

Former Member
0 Likes
380

Hello Vimal,

You can retrieve the data into an internal table and inside your report directly insert the data into the MSSQL server using specific NATIVE SQL statements.

But you need to configure the Transction :DBCO for your MSSQL server database like this :

DB Connection +DBO+0050

DBMS MSS

User Name

DB password /

Conn. info MSSQL_SERVER=iwdf7yt4 MSSQL_DBNAME=IDU OBJECT_SOURCE=idu

Connection Limit 0

Optimum Conns 0

Check the following OSS Messages : 323151, 178949, 738371

Here is a sample code :

DATA: exc_ref TYPE REF TO cx_sy_native_sql_error,

error_text TYPE string.

TRY.

EXEC SQL.

SET CONNECTION 'SSI_SQL'

ENDEXEC.

EXEC SQL.

CONNECT TO 'SSI_SQL'

ENDEXEC.

EXEC SQL.

INSERT INTO SHIFT

(shift_id, shift_name)

VALUES ('8', 'test');

ENDEXEC.

IF SY-SUBRC <> 0.

ENDIF.

CATCH cx_sy_native_sql_error INTO exc_ref.

error_text = exc_ref->get_text( ).

MESSAGE error_text TYPE 'I'.

ENDTRY.

EXEC SQL.

SET CONNECTION DEFAULT

ENDEXEC.

*EXEC SQL.

  • SELECT db_name() INTO :DBN FROM SVERS

*ENDEXEC.

*WRITE: / 'current database name', DBN.

Hope this solves your probem.

Thanks,

Greetson

Read only

0 Likes
380

hi greetson,

thanks for ur reply.one more clarification.

actually we r using .NET connector so i want to upload the data in .NET, already they are creating structure like my report output format, so how to transfer the data ? BDC method or which method to approach ?

Read only

0 Likes
380

BAPI.