Qlik Community

QlikView Connectors

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

rklaytonmb
New Contributor III

SAP Report Error

I'm having trouble configuring FIELD_AUTO_COLUMNS in sap report, because the category for the report header is ranging from 2 to 3.

Does anybody experienced this and can  help me?

Grateful!

1 Solution

Accepted Solutions
rklaytonmb
New Contributor III

Re: SAP Report Error

Hi everyone, thank you all

I found the solution, developing the script manually in this way

[ZSDR_MADAT_AUX]:

Load

SubField([Field0_],'!',2) AS 'Doc.fatur.',

SubField([Field0_],'!',6) AS 'Data',

SubField([Field0_],'!',13) AS 'Chave de tabela',

SubField([Field0_],'!',14) AS 'Prorrogação';

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1),

SKIP (P(0,"┌──────────┬─────────┬──────────┬─────┬──────────┬────────┬────────────┬──────┬─────────────────────┬─────────┬─────┬────────────────────────┬──────────┬──────────┐"),

     P(0,"!Doc.fatur.!TpDocFat.!Dt.fatur. !Empr.!Data      !Hora    !Usuário     !Objeto!Valor do objeto      !Nº doc.  !Campo!Chave de tabela         !Valor novo!Val.antigo!"),

     P(0,"├──────────┼─────────┼──────────┼─────┼──────────┼────────┼────────────┼──────┼─────────────────────┼─────────┼─────┼────────────────────────┼──────────┼──────────┤"),

     P(0,"└──────────┴─────────┴──────────┴─────┴──────────┴────────┴────────────┴──────┴─────────────────────┴─────────┴─────┴────────────────────────┴──────────┴──────────┘")),

OPTIONS (

(SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW $(vDateMin), HIGH $(vDateMax))

(SELNAME S_VBELN, KIND S, SIGN I, OPTION BT, LOW $(vDocMin), HIGH $(vDocMax))));

7 Replies
Employee
Employee

Re: SAP Report Error

Hi Klayton,

In the Gui, was it possible to select the checkbox for "Auto Detect Column Width" ?

If yes, what happens when doing a "Reload" ?

If no, because it is disabled -  then it may not be possible to use the "Auto Detect..." feature.

Can you add the script too?

Br,

Tomas

rklaytonmb
New Contributor III

Re: SAP Report Error

In the Gui, was it possible to select the checkbox for "Auto Detect Column Width" ?

Yes, it was.

*** Its DONT work ( see FIELD_AUTO_COLUMNS (2) )


Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (2),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161201, HIGH 20161201)

(SELNAME  (S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005769548, HIGH 9005769548)))

*** Its work ( see FIELD_AUTO_COLUMNS (3) )

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (3),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161201, HIGH 20161201)

(SELNAME S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005769548, HIGH 9005769548)))

However

*** Its work ( see FIELD_AUTO_COLUMNS (2) )

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (2),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161125, HIGH 20161125)

(SELNAME  (S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005750120, HIGH 9005796298)))

*** Its DONT work ( see FIELD_AUTO_COLUMNS (3) )

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (2),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161125, HIGH 20161125)

(SELNAME  (S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005750120, HIGH 9005796298)))

*** Note that only the parameters are modified ***

rklaytonmb
New Contributor III

Re: SAP Report Error

Hi Tomas

Yes,  "Auto Detect Columm Width" was able

Observe the clause FIELD_AUTO_COLUMNS  in the following instructions

Its dont work

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (2),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161201, HIGH 20161201)

(SELNAME  (S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005769548, HIGH 9005769548)))

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (3),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161201, HIGH 20161201)

(SELNAME S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005769548, HIGH 9005769548)))

However, its work

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (3),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161201, HIGH 20161201)

(SELNAME  (S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005769548, HIGH 9005769548)))

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1), FIELD_AUTO_COLUMNS (2),

OPTIONS ((SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20161201, HIGH 20161201)

(SELNAME S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9005769548, HIGH 9005769548)))

rklaytonmb
New Contributor III

Re: SAP Report Error

Hi Tomas,

Another information, sometimes the result for the statement below shows the report header as an output and in other executions with the same parameters the result is another, without the header line

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1) , FIELD_AUTO_COLUMNS (2),

OPTIONS (

  (SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW 20170523, HIGH 20170523),

  (SELNAME S_VBELN, KIND S, SIGN I, OPTION BT, LOW 9006086872, HIGH 9006383819))

  );

SAPREPORT.png

Employee
Employee

Re: SAP Report Error

Hi Klayton,

Which version of the Qlik SAP Report Connector are you using?

When you first choose this Report, which number is shown in the FIELD_AUTO_COLUMNS - parameter in the script, is it '2' or '3' (or something else)?

Reports are in nature tricky to handle for the connector as it depends on a spool file being generated from SAP when running the job. This spool file contains several control tables, like the Category, that are used by the auto detect feature. As it is implemented today, the auto detect feature needs a fairly straightforward report structure, although the content may be changing in width from one job to another, depending on the data.

Having a more complex report, it may be necessary to build the script manually in the GUI (see Qlik online help for more info).


Br,

Tomas

neha_shirsath
Valued Contributor

Re: SAP Report Error

Hi Klayton,

How frequently your width of that field get change??

Because I was facing the same issue then i was use to fix it manually calculating width of every fields.

And it is customized Z report you are fetching?

Thanks,

Neha

rklaytonmb
New Contributor III

Re: SAP Report Error

Hi everyone, thank you all

I found the solution, developing the script manually in this way

[ZSDR_MADAT_AUX]:

Load

SubField([Field0_],'!',2) AS 'Doc.fatur.',

SubField([Field0_],'!',6) AS 'Data',

SubField([Field0_],'!',13) AS 'Chave de tabela',

SubField([Field0_],'!',14) AS 'Prorrogação';

Select SAPREPORT (REPORT (ZSDR_MADAT), ROWS_PER_RECORD (1),

SKIP (P(0,"┌──────────┬─────────┬──────────┬─────┬──────────┬────────┬────────────┬──────┬─────────────────────┬─────────┬─────┬────────────────────────┬──────────┬──────────┐"),

     P(0,"!Doc.fatur.!TpDocFat.!Dt.fatur. !Empr.!Data      !Hora    !Usuário     !Objeto!Valor do objeto      !Nº doc.  !Campo!Chave de tabela         !Valor novo!Val.antigo!"),

     P(0,"├──────────┼─────────┼──────────┼─────┼──────────┼────────┼────────────┼──────┼─────────────────────┼─────────┼─────┼────────────────────────┼──────────┼──────────┤"),

     P(0,"└──────────┴─────────┴──────────┴─────┴──────────┴────────┴────────────┴──────┴─────────────────────┴─────────┴─────┴────────────────────────┴──────────┴──────────┘")),

OPTIONS (

(SELNAME S_FKDAT, KIND S, SIGN I, OPTION BT, LOW $(vDateMin), HIGH $(vDateMax))

(SELNAME S_VBELN, KIND S, SIGN I, OPTION BT, LOW $(vDocMin), HIGH $(vDocMax))));